Add instant-casting to wizards

This commit is contained in:
libraryaddict 2015-03-25 19:21:20 +13:00
parent 4988b90d0e
commit 853e6420dd
2 changed files with 35 additions and 23 deletions

View File

@ -25,15 +25,23 @@ public class SpellButton implements IButton
Wizard wizard = _spellPage.getWizards().getWizard(player);
if (wizard != null)
{
if (clickType.isLeftClick())
{
wizard.setSpell(player.getInventory().getHeldItemSlot(), _spell);
player.sendMessage(C.cBlue + "Set spell on wand to " + _spell.getElement().getColor() + _spell.getSpellName());
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 10, 1);
}
else
{
_spellPage.getWizards().castSpell(player, wizard, _spell, null);
}
_spellPage.getWizards().drawUtilTextBottom(player);
_spellPage.getWizards().changeWandsTitles(player);
player.closeInventory();
}
}

View File

@ -76,6 +76,10 @@ public class SpellMenuPage extends ShopPageBase<WizardSpellMenu, WizardSpellMenu
builder.addLore(C.cGray + lore, 35);
}
builder.addLore("");
builder.addLore(C.cPurple + C.Bold + "LEFT CLICK" + C.cDGreen + " Bind spell");
builder.addLore(C.cGreen + C.Bold + "RIGHT CLICK" + C.cBlue + " Instant Cast");
if (wizard == null)
{
addItem(i, new ShopItem(builder.build(), spell.name(), spell.name(), 1, true, true));