Skip to content

Commit

Permalink
Merge pull request runejs#287 from hallowatcher/fix-plugin-imports
Browse files Browse the repository at this point in the history
fix remaining broken stuff after filestore upgrade
  • Loading branch information
Promises authored Apr 7, 2021
2 parents afae3de + aac598e commit 70e01ec
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/plugins/combat/combat.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class Combat {
let deathAnim: number = animationIds.death;

if(victim instanceof Npc) {
deathAnim = findNpc(victim.id)?.animations?.death || animationIds.death
deathAnim = findNpc(victim.id)?.combatAnimations?.death || animationIds.death
}

this.cancelCombat();
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/commands/bank-command.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const action: commandActionHandler = (details) => {
orientation: 0,
type: 0
},
objectDefinition: undefined,
objectConfig: undefined,
option: 'use-quickly',
position: details.player.position,
cacheOriginal: undefined
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/items/buckets/fill-container.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const WellIds: number[] = [878];
export const handler: itemOnObjectActionHandler = (details) => {
const { player, objectConfig, item } = details;
const itemDef = findItem(item.itemId);
if (item.itemId !== itemIds.bucket && WellIds.indexOf(objectConfig.id) > -1) {
if (item.itemId !== itemIds.bucket && WellIds.indexOf(objectConfig.gameId) > -1) {
player.sendMessage(`If I drop my ${itemDef.name.toLowerCase()} down there, I don't think I'm likely to get it back.`);
return;
}
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/items/herblore/clean-herb.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { itemAction, ItemActionData } from '@server/world/action/item-action';
import { findItem, widgets } from '@server/config';
import { soundIds } from '@server/world/config/sound-ids';
import { ItemDetails } from '@server/config/item-config';
import { itemInteractionActionHandler } from '@engine/world/action/item-interaction.action';
import { findItem, widgets } from '@engine/config';
import { soundIds } from '@engine/world/config/sound-ids';
import { ItemDetails } from '@engine/config/item-config';

interface IGrimyHerb {
grimy: ItemDetails;
Expand Down Expand Up @@ -97,7 +97,7 @@ const herbs: IGrimyHerb[] = [
]


export const action: itemAction = (details: ItemActionData) => {
export const action: itemInteractionActionHandler = details => {
const { player, itemId, itemSlot } = details;
const herb: IGrimyHerb = herbs.find((herb) => herb.grimy.gameId === itemId);
if(!herb) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function openBank(player: Player) {
orientation: 0,
type: 0
},
objectDefinition: undefined,
objectConfig: undefined,
option: 'use-quickly',
position: player.position,
cacheOriginal: undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export const goblinDiplomacyStageHandler: QuestStageHandler = {
await schedule(3);

const goblinDetails = findNpc('rs:goblin');
let anim = goblinDetails.animations.attack;
let anim = goblinDetails.combatAnimations.attack;
if(Array.isArray(anim)) {
anim = anim[0];
}
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/skills/smithing/forging-constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { itemIds } from '@server/world/config/item-ids';
import { Smithable } from '@server/plugins/skills/smithing/forging-types';
import { itemIds } from '@engine/world/config/item-ids';
import { Smithable } from '@plugins/skills/smithing/forging-types';

export const anvilIds: number[] = [
2782, 2783, 4306, 6150
Expand Down
27 changes: 13 additions & 14 deletions src/plugins/skills/smithing/forging-plugin.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { itemOnObjectAction } from '@server/world/action/item-on-object-action';
import { widgets } from '@server/config';
import { Skill } from '@server/world/actor/skills';
import { bars, smithables, widgetItems } from '@server/plugins/skills/smithing/forging-constants';
import { itemIds } from '@server/world/config/item-ids';
import { cache } from '@server/game-server';
import { Smithable } from '@server/plugins/skills/smithing/forging-types';
import { itemAction } from '@server/world/action/item-action';
import { loopingAction } from '@server/world/action';
import { Player } from '@server/world/actor/player/player';
import { itemOnObjectActionHandler } from '@engine/world/action/item-on-object.action';
import { widgets } from '@engine/config';
import { Skill } from '@engine/world/actor/skills';
import { bars, smithables, widgetItems } from '@plugins/skills/smithing/forging-constants';
import { itemIds } from '@engine/world/config/item-ids';
import { Smithable } from '@plugins/skills/smithing/forging-types';
import { itemInteractionActionHandler } from '@engine/world/action/item-interaction.action';
import { loopingEvent } from '@engine/game-server';
import { Player } from '@engine/world/actor/player/player';
import { findItem } from '@engine/config';

const mapWidgetItemsToFlatArray = (input) => {
Expand Down Expand Up @@ -36,10 +35,10 @@ const findSmithableByItemId = (itemId) : Smithable => {
});
};

const smithItem : itemAction = (details) => {
const smithItem: itemInteractionActionHandler = (details) => {
const { player, option, itemDetails } = details;

const smithable = findSmithableByItemId(itemDetails.id);
const smithable = findSmithableByItemId(itemDetails.gameId);


// In case the smithable doesn't exist.
Expand All @@ -59,7 +58,7 @@ const smithItem : itemAction = (details) => {
// Close the forging interface.
player.interfaceState.closeAllSlots();

const loop = loopingAction({ player: details.player });
const loop = loopingEvent({ player: details.player });
let elapsedTicks = 0;
let wantedAmount = 0;
let forgedAmount = 0;
Expand Down Expand Up @@ -111,7 +110,7 @@ const hasIngredients = (player: Player, smithable: Smithable) => {
return smithable.ingredient.amount <= player.inventory.findAll(smithable.ingredient.itemId).length;
};

const openForgingInterface : itemOnObjectAction = (details) => {
const openForgingInterface: itemOnObjectActionHandler = (details) => {
const { player, item } = details;
const amountInInventory = player.inventory.findAll(item).length;

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/skills/smithing/forging-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Item } from '@server/world/items/item';
import { Item } from '@engine/world/items/item';
export interface Smithable {
item: Item;
level: number;
Expand Down

0 comments on commit 70e01ec

Please sign in to comment.