Replacing elemental skill shortcuts.
This commit is contained in:
@@ -292,4 +292,23 @@ public class ShortCuts implements IRestorable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the shortcut icon with the new skill.
|
||||
* @param skillId the skill Id to search.
|
||||
* @param newSkillId the skill Id to replace.
|
||||
*/
|
||||
public void replaceShortCuts(int skillId, int newSkillId)
|
||||
{
|
||||
// Replace all the shortcuts with the new skill
|
||||
for (Shortcut sc : _shortCuts.values())
|
||||
{
|
||||
if ((sc.getId() == skillId) && (sc.getType() == ShortcutType.SKILL))
|
||||
{
|
||||
final Shortcut newsc = new Shortcut(sc.getSlot(), sc.getPage(), sc.getType(), newSkillId, sc.getLevel(), 1);
|
||||
_owner.sendPacket(new ShortCutRegister(newsc));
|
||||
_owner.registerShortCut(newsc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1651,6 +1651,16 @@ public final class L2PcInstance extends L2Playable
|
||||
_shortCuts.updateShortCuts(skillId, skillLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the shortcut icon with the new skill.
|
||||
* @param skillId the skill Id to search.
|
||||
* @param newSkillId the skill Id to replace.
|
||||
*/
|
||||
public void replaceShortCuts(int skillId, int newSkillId)
|
||||
{
|
||||
_shortCuts.replaceShortCuts(skillId, newSkillId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the L2ShortCut corresponding to the position (page-slot) from the L2PcInstance _shortCuts.
|
||||
* @param slot
|
||||
|
Reference in New Issue
Block a user