-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from rune-js/plugins
Reworking the plugin a system a bit to be less rigid.
- Loading branch information
Showing
26 changed files
with
148 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { buttonAction, ButtonActionPlugin } from '@server/world/mob/player/action/button-action'; | ||
import { buttonAction } from '@server/world/mob/player/action/button-action'; | ||
import { ActionType, RunePlugin } from '@server/plugins/plugin'; | ||
|
||
export const action: buttonAction = (details) => { | ||
const { player } = details; | ||
player.logout(); | ||
}; | ||
|
||
export default { buttonIds: 2458, action } as ButtonActionPlugin; | ||
export default new RunePlugin({ type: ActionType.BUTTON, buttonIds: 2458, action }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/plugins/npc/lumbridge/general-store/shopkeeper-plugin.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { npcAction } from '@server/world/mob/player/action/npc-action'; | ||
import { openShop } from '@server/world/mob/player/action/shop-action'; | ||
import { ActionType, RunePlugin } from '@server/plugins/plugin'; | ||
|
||
const action: npcAction = (details) => { | ||
const { player, npc } = details; | ||
openShop(details.player, 'BOBS_AXES'); | ||
}; | ||
|
||
export default new RunePlugin({ type: ActionType.NPC_ACTION, npcIds: 519, options: 'trade', walkTo: true, action }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { npcAction } from '@server/world/mob/player/action/npc-action'; | ||
import { openShop } from '@server/world/mob/player/action/shop-action'; | ||
import { ActionType, RunePlugin } from '@server/plugins/plugin'; | ||
|
||
|
||
const action: npcAction = (details) => { | ||
const { player, npc } = details; | ||
openShop(details.player, 'LUMBRIDGE_GENERAL_STORE'); | ||
}; | ||
|
||
export default new RunePlugin({ type: ActionType.NPC_ACTION, npcIds: 520, options: 'trade', walkTo: true, action }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { NpcActionPlugin } from '@server/world/mob/player/action/npc-action'; | ||
import { ObjectActionPlugin } from '@server/world/mob/player/action/object-action'; | ||
import { ButtonActionPlugin } from '@server/world/mob/player/action/button-action'; | ||
import { ItemOnItemActionPlugin } from '@server/world/mob/player/action/item-on-item-action'; | ||
|
||
export enum ActionType { | ||
BUTTON = 'button', | ||
ITEM_ON_ITEM = 'item_on_item', | ||
NPC_ACTION = 'npc_action', | ||
OBJECT_ACTION = 'object_action', | ||
COMMAND = 'command' | ||
} | ||
|
||
export interface ActionPlugin { | ||
type: ActionType; | ||
} | ||
|
||
export class RunePlugin { | ||
|
||
public actions: (NpcActionPlugin | ObjectActionPlugin | ButtonActionPlugin | ItemOnItemActionPlugin)[]; | ||
|
||
public constructor(actions: NpcActionPlugin | ObjectActionPlugin | ButtonActionPlugin | ItemOnItemActionPlugin | | ||
(NpcActionPlugin | ObjectActionPlugin | ButtonActionPlugin | ItemOnItemActionPlugin)[]) { | ||
if(!Array.isArray(actions)) { | ||
this.actions = [actions]; | ||
} else { | ||
this.actions = actions; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.