forked from runejs/server
-
Notifications
You must be signed in to change notification settings - Fork 0
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 runejs#198 from SchauweM/feature/skillcape-emotes
Feature/skillcape emotes
- Loading branch information
Showing
7 changed files
with
186 additions
and
29 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
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,32 @@ | ||
import { lockEmote, unlockEmote } from '@server/plugins/buttons/player-emotes-plugin'; | ||
import { ActionType, RunePlugin } from '@server/plugins/plugin'; | ||
import { equipAction } from '@server/world/actor/player/action/equip-action'; | ||
import { itemIds } from '@server/world/config/item-ids'; | ||
|
||
export const skillcapeIds: Array<number> = Object.keys( | ||
itemIds.skillCapes).flatMap(skill => [itemIds.skillCapes[skill].untrimmed, itemIds.skillCapes[skill].trimmed] | ||
); | ||
|
||
export const equip: equipAction = (details) => { | ||
const {player} = details; | ||
unlockEmote(player, 'SKILLCAPE'); | ||
}; | ||
|
||
export const unequip: equipAction = (details) => { | ||
const {player} = details; | ||
lockEmote(player, 'SKILLCAPE'); | ||
player.stopAnimation(); | ||
player.stopGraphics(); | ||
}; | ||
|
||
export default new RunePlugin([{ | ||
type: ActionType.EQUIP_ACTION, | ||
equipType: 'EQUIP', | ||
action: equip, | ||
itemIds: skillcapeIds | ||
}, { | ||
type: ActionType.EQUIP_ACTION, | ||
equipType: 'UNEQUIP', | ||
action: unequip, | ||
itemIds: skillcapeIds | ||
}]); |
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