Add instant-casting to wizards
This commit is contained in:
parent
4988b90d0e
commit
853e6420dd
|
@ -25,15 +25,23 @@ public class SpellButton implements IButton
|
||||||
Wizard wizard = _spellPage.getWizards().getWizard(player);
|
Wizard wizard = _spellPage.getWizards().getWizard(player);
|
||||||
|
|
||||||
if (wizard != null)
|
if (wizard != null)
|
||||||
|
{
|
||||||
|
if (clickType.isLeftClick())
|
||||||
{
|
{
|
||||||
wizard.setSpell(player.getInventory().getHeldItemSlot(), _spell);
|
wizard.setSpell(player.getInventory().getHeldItemSlot(), _spell);
|
||||||
|
|
||||||
player.sendMessage(C.cBlue + "Set spell on wand to " + _spell.getElement().getColor() + _spell.getSpellName());
|
player.sendMessage(C.cBlue + "Set spell on wand to " + _spell.getElement().getColor() + _spell.getSpellName());
|
||||||
|
|
||||||
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 10, 1);
|
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 10, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_spellPage.getWizards().castSpell(player, wizard, _spell, null);
|
||||||
|
}
|
||||||
|
|
||||||
_spellPage.getWizards().drawUtilTextBottom(player);
|
_spellPage.getWizards().drawUtilTextBottom(player);
|
||||||
_spellPage.getWizards().changeWandsTitles(player);
|
_spellPage.getWizards().changeWandsTitles(player);
|
||||||
|
player.closeInventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,10 @@ public class SpellMenuPage extends ShopPageBase<WizardSpellMenu, WizardSpellMenu
|
||||||
builder.addLore(C.cGray + lore, 35);
|
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)
|
if (wizard == null)
|
||||||
{
|
{
|
||||||
addItem(i, new ShopItem(builder.build(), spell.name(), spell.name(), 1, true, true));
|
addItem(i, new ShopItem(builder.build(), spell.name(), spell.name(), 1, true, true));
|
||||||
|
|
Loading…
Reference in New Issue