Wizards: Latest changes by Chiss

This commit is contained in:
libraryaddict 2015-04-21 13:54:19 +12:00
parent cd47da179a
commit 0196a5c359
8 changed files with 278 additions and 184 deletions

View File

@ -41,6 +41,7 @@ public class SpellButton implements IButton
_spellPage.getWizards().drawUtilTextBottom(player); _spellPage.getWizards().drawUtilTextBottom(player);
_spellPage.getWizards().changeWandsTitles(player); _spellPage.getWizards().changeWandsTitles(player);
_spellPage.getWizards().changeWandsType(player, -1, player.getInventory().getHeldItemSlot());
player.closeInventory(); player.closeInventory();
} }

View File

@ -63,13 +63,13 @@ public class SpellMenuPage extends ShopPageBase<WizardSpellMenu, WizardSpellMenu
{ {
ItemBuilder builder = new ItemBuilder(spell.getSpellItem()); ItemBuilder builder = new ItemBuilder(spell.getSpellItem());
builder.setTitle(spell.getElement().getColor() + spell.getSpellName()); builder.setTitle(spell.getElement().getColor() + C.Bold + spell.getSpellName());
builder.addLore(""); builder.addLore("");
builder.addLore(C.cBlue + C.Bold + "Spell Level: " + C.cWhite + spellLevel); builder.addLore(C.cYellow + C.Bold + "Spell Level: " + C.cWhite + spellLevel);
builder.addLore(C.cBlue + C.Bold + "Mana Cost: " + C.cWhite builder.addLore(C.cYellow + C.Bold + "Mana Cost: " + C.cWhite
+ (wizard == null ? spell.getBaseManaCost() : spell.getManaCost(wizard))); + (wizard == null ? spell.getBaseManaCost() : spell.getManaCost(wizard)));
builder.addLore(C.cBlue + C.Bold + "Cooldown: " + C.cWhite builder.addLore(C.cYellow + C.Bold + "Cooldown: " + C.cWhite
+ (wizard == null ? spell.getBaseCooldown() : spell.getSpellCooldown(wizard)) + " seconds"); + (wizard == null ? spell.getBaseCooldown() : spell.getSpellCooldown(wizard)) + " seconds");
builder.addLore(""); builder.addLore("");
@ -87,9 +87,9 @@ public class SpellMenuPage extends ShopPageBase<WizardSpellMenu, WizardSpellMenu
builder.addLore(""); builder.addLore("");
builder.addLore(C.cPurple + C.Bold + "LEFT CLICK" + C.cDGreen + " Bind to Wand"); builder.addLore(C.cGreen + C.Bold + "Left-click" + C.cWhite + " Bind to Wand");
builder.addLore(C.cGreen + C.Bold + "RIGHT CLICK" + C.cBlue + " Quickcast Spell"); builder.addLore(C.cGreen + C.Bold + "Right-click" + C.cWhite + " Quickcast Spell");
addButton(i, new ShopItem(builder.build(), spell.name(), spell.name(), 1, true, true), new SpellButton( addButton(i, new ShopItem(builder.build(), spell.name(), spell.name(), 1, true, true), new SpellButton(
this, spell)); this, spell));

View File

@ -9,8 +9,9 @@ import org.bukkit.inventory.ItemStack;
public enum SpellType // public enum SpellType //
{ {
Droom(SpellElement.ATTACK, // Spell element AnvilDrop(SpellElement.ATTACK, // Spell element
"Droom", // Spell name WandElement.EARTH, // Wand element
"Anvil Drop", // Spell name
new ItemStack(Material.NETHER_BRICK_ITEM), // Spell icon new ItemStack(Material.NETHER_BRICK_ITEM), // Spell icon
SpellDroom.class, // Spell class SpellDroom.class, // Spell class
3, // Spell max level 3, // Spell max level
@ -20,7 +21,7 @@ public enum SpellType // ❤
-4, // Cooldown change per level -4, // Cooldown change per level
10, // Item amount in loot 10, // Item amount in loot
C.cGold + C.Bold + "Damage: " + C.Bold + C.cWhite + "(Spell Level x 2) + 3", C.cYellow + C.Bold + "Damage: " + C.Bold + C.cWhite + "(Spell Level x 2) + 3",
"", "",
@ -29,8 +30,9 @@ public enum SpellType // ❤
"This also includes the caster!"), "This also includes the caster!"),
Fireball(SpellElement.ATTACK, // Spell element Fireball(SpellElement.ATTACK, // Spell element
WandElement.FIRE, // Wand element
"Fireball", // Spell name "Fireball", // Spell name
new ItemStack(Material.FIREWORK_CHARGE), // Spell icon new ItemStack(Material.COAL), // Spell icon
SpellFireball.class, // Spell class SpellFireball.class, // Spell class
3, // Spell max level 3, // Spell max level
30, // Mana cost 30, // Mana cost
@ -39,7 +41,7 @@ public enum SpellType // ❤
-2, // Cooldown change per level -2, // Cooldown change per level
10, // Item amount in loot 10, // Item amount in loot
C.cGold + C.Bold + "Damage: " + C.Bold + C.cWhite + "Spell Level + 3", C.cYellow + C.Bold + "Damage: " + C.Bold + C.cWhite + "Spell Level + 3",
"", "",
@ -48,6 +50,7 @@ public enum SpellType // ❤
"Summon a blazing fireball!"), "Summon a blazing fireball!"),
Flash(SpellElement.SUPPORT, // Spell element Flash(SpellElement.SUPPORT, // Spell element
WandElement.LIFE, // Wand element
"Flash", // Spell name "Flash", // Spell name
new ItemStack(Material.GOLD_NUGGET), // Spell icon new ItemStack(Material.GOLD_NUGGET), // Spell icon
SpellFlash.class, // Spell class SpellFlash.class, // Spell class
@ -58,13 +61,14 @@ public enum SpellType // ❤
-5, // Cooldown change per level -5, // Cooldown change per level
3, // Item amount in loot 3, // Item amount in loot
C.cGold + C.Bold + "Range: " + C.Bold + C.cWhite + "(Spell Level x 10) + 20", C.cYellow + C.Bold + "Range: " + C.Bold + C.cWhite + "(Spell Level x 10) + 20",
"", "",
"Teleport to the block you are looking at!"), "Teleport to the block you are looking at!"),
FrostBarrier(SpellElement.MISC, // Spell element FrostBarrier(SpellElement.MISC, // Spell element
WandElement.ICE, // Wand element
"Frost Barrier", // Spell name "Frost Barrier", // Spell name
new ItemStack(Material.MONSTER_EGG), // Spell icon new ItemStack(Material.MONSTER_EGG), // Spell icon
SpellFrostBarrier.class, // Spell class SpellFrostBarrier.class, // Spell class
@ -75,15 +79,16 @@ public enum SpellType // ❤
-5, // Cooldown change per level -5, // Cooldown change per level
3, // Item amount in loot 3, // Item amount in loot
C.cGold + C.Bold + "Height: " + C.Bold + C.cWhite + "Spell Level + 1", C.cYellow + C.Bold + "Height: " + C.Bold + C.cWhite + "Spell Level + 1",
C.cGold + C.Bold + "Width: " + C.Bold + C.cWhite + "(Spell Level x 2) + 4", C.cYellow + C.Bold + "Width: " + C.Bold + C.cWhite + "(Spell Level x 2) + 4",
"", "",
"Create a wall of ice!"), "Create a wall of ice!"),
Gust(SpellElement.MISC, // Spell element Gust(SpellElement.MISC, // Spell element
WandElement.AIR, // Wand element
"Gust", // Spell name "Gust", // Spell name
new ItemStack(Material.SULPHUR), // Spell icon new ItemStack(Material.SULPHUR), // Spell icon
SpellGust.class, // Spell class SpellGust.class, // Spell class
@ -94,15 +99,16 @@ public enum SpellType // ❤
0, // Cooldown change per level 0, // Cooldown change per level
5, // Item amount in loot 5, // Item amount in loot
C.cGold + C.Bold + "Gust Size: " + C.Bold + C.cWhite + "10 x Spell Level blocks", C.cYellow + C.Bold + "Gust Size: " + C.Bold + C.cWhite + "10 x Spell Level blocks",
C.cGold + C.Bold + "Gust Strenth: " + C.Bold + C.cWhite + "Spell Level x 30%", C.cYellow + C.Bold + "Gust Strenth: " + C.Bold + C.cWhite + "Spell Level x 30%",
"", "",
"Cast the spell and watch your enemies fly!"), "Cast the spell and watch your enemies fly!"),
Heal(SpellElement.SUPPORT, // Spell element Heal(SpellElement.SUPPORT, // Spell element
WandElement.LIFE, // Wand element
"Heal", // Spell name "Heal", // Spell name
new ItemStack(Material.QUARTZ), // Spell icon new ItemStack(Material.QUARTZ), // Spell icon
SpellHeal.class, // Spell class SpellHeal.class, // Spell class
@ -113,7 +119,7 @@ public enum SpellType // ❤
-1, // Cooldown change per level -1, // Cooldown change per level
5, // Item amount in loot 5, // Item amount in loot
C.cGold + C.Bold + "Heals: " + C.Bold + C.cWhite + "(Spell Level / 2) + 1.5", C.cYellow + C.Bold + "Heals: " + C.Bold + C.cWhite + "(Spell Level / 2) + 1.5",
"", "",
@ -122,8 +128,9 @@ public enum SpellType // ❤
"Use this! Heal yourself up!"), "Use this! Heal yourself up!"),
IcePrison(SpellElement.MISC, // Spell element IcePrison(SpellElement.MISC, // Spell element
WandElement.ICE, // Wand element
"Ice Prison", // Spell name "Ice Prison", // Spell name
new ItemStack(Material.BOOK_AND_QUILL), // Spell icon new ItemStack(Material.EYE_OF_ENDER), // Spell icon
SpellIcePrison.class, // Spell class SpellIcePrison.class, // Spell class
3, // Spell max level 3, // Spell max level
50, // Mana cost 50, // Mana cost
@ -132,7 +139,7 @@ public enum SpellType // ❤
0, // Cooldown change per level 0, // Cooldown change per level
3, // Item amount in loot 3, // Item amount in loot
C.cGold + C.Bold + "Size: " + C.Bold + C.cWhite + "Spell Level + 3", C.cYellow + C.Bold + "Size: " + C.Bold + C.cWhite + "Spell Level + 3",
"", "",
@ -141,6 +148,7 @@ public enum SpellType // ❤
"prison to capture thy enemies!"), "prison to capture thy enemies!"),
IceShards(SpellElement.ATTACK, // Spell element IceShards(SpellElement.ATTACK, // Spell element
WandElement.ICE, // Wand element
"Ice Shards", // Spell name "Ice Shards", // Spell name
new ItemStack(Material.GOLDEN_CARROT), // Spell icon new ItemStack(Material.GOLDEN_CARROT), // Spell icon
SpellIceShards.class, // Spell class SpellIceShards.class, // Spell class
@ -151,9 +159,9 @@ public enum SpellType // ❤
-2, // Cooldown change per level -2, // Cooldown change per level
3, // Item amount in loot 3, // Item amount in loot
C.cGold + C.Bold + "Damage: " + C.Bold + C.cWhite + "2", C.cYellow + C.Bold + "Damage: " + C.Bold + C.cWhite + "2",
C.cGold + C.Bold + "Shards: " + C.Bold + C.cWhite + "Spell Level + 1", C.cYellow + C.Bold + "Shards: " + C.Bold + C.cWhite + "Spell Level + 1",
"", "",
@ -166,6 +174,7 @@ public enum SpellType // ❤
"enemies senseless!"), "enemies senseless!"),
Implode(SpellElement.MISC, // Spell element Implode(SpellElement.MISC, // Spell element
WandElement.EARTH, // Wand element
"Implode", // Spell name "Implode", // Spell name
new ItemStack(Material.GLOWSTONE_DUST), // Spell icon new ItemStack(Material.GLOWSTONE_DUST), // Spell icon
SpellImplode.class, // Spell class SpellImplode.class, // Spell class
@ -176,11 +185,11 @@ public enum SpellType // ❤
-3, // Cooldown change per level -3, // Cooldown change per level
3, // Item amount in loot 3, // Item amount in loot
C.cGold + C.Bold + "Range: " + C.Bold + C.cWhite + "50", C.cYellow + C.Bold + "Range: " + C.Bold + C.cWhite + "50",
C.cGold + C.Bold + "Implosion Height: " + C.Bold + C.cWhite + "Spell Level", C.cYellow + C.Bold + "Implosion Height: " + C.Bold + C.cWhite + "Spell Level",
C.cGold + C.Bold + "Implosion Width: " + C.Bold + C.cWhite + "Spell Level x 2", C.cYellow + C.Bold + "Implosion Width: " + C.Bold + C.cWhite + "Spell Level x 2",
"", "",
@ -189,6 +198,7 @@ public enum SpellType // ❤
"and scatters them about the area"), "and scatters them about the area"),
LightningStrike(SpellElement.ATTACK, // Spell element LightningStrike(SpellElement.ATTACK, // Spell element
WandElement.AIR, // Wand element
"Lightning Strike", // Spell name "Lightning Strike", // Spell name
new ItemStack(Material.SLIME_BALL), // Spell icon new ItemStack(Material.SLIME_BALL), // Spell icon
SpellLightningStrike.class, // Spell class SpellLightningStrike.class, // Spell class
@ -199,7 +209,7 @@ public enum SpellType // ❤
0, // Cooldown change per level 0, // Cooldown change per level
10, // Item amount in loot 10, // Item amount in loot
C.cGold + C.Bold + "Damage: " + C.Bold + C.cWhite + "(Spell Level x 2) + 2", C.cYellow + C.Bold + "Damage: " + C.Bold + C.cWhite + "(Spell Level x 2) + 2",
"", "",
@ -210,6 +220,7 @@ public enum SpellType // ❤
"The lightning also contains fire!"), "The lightning also contains fire!"),
MagicMissile(SpellElement.ATTACK, // Spell element MagicMissile(SpellElement.ATTACK, // Spell element
WandElement.NORMAL, // Wand element
"Magic Missile", // Spell name "Magic Missile", // Spell name
new ItemStack(Material.MELON_SEEDS), // Spell icon new ItemStack(Material.MELON_SEEDS), // Spell icon
SpellMagicMissile.class, // Spell class SpellMagicMissile.class, // Spell class
@ -220,9 +231,9 @@ public enum SpellType // ❤
0, // Cooldown change per level 0, // Cooldown change per level
15, // Item amount in loot 15, // Item amount in loot
C.cGold + C.Bold + "Damage: " + C.Bold + C.cWhite + "Spell Level + 3", C.cYellow + C.Bold + "Damage: " + C.Bold + C.cWhite + "Spell Level + 3",
C.cGold + C.Bold + "Range: " + C.Bold + C.cWhite + "(Spell Level x 10) + 20", C.cYellow + C.Bold + "Range: " + C.Bold + C.cWhite + "(Spell Level x 10) + 20",
"", "",
@ -230,6 +241,7 @@ public enum SpellType // ❤
+ "the magic profession and homes in towards the closest target!"), + "the magic profession and homes in towards the closest target!"),
Napalm(SpellElement.ATTACK, // Spell element Napalm(SpellElement.ATTACK, // Spell element
WandElement.FIRE, // Wand element
"Napalm", // Spell name "Napalm", // Spell name
new ItemStack(Material.CARROT_STICK), // Spell icon new ItemStack(Material.CARROT_STICK), // Spell icon
SpellNapalm.class, // Spell class SpellNapalm.class, // Spell class
@ -240,7 +252,7 @@ public enum SpellType // ❤
-10, // Cooldown change per level -10, // Cooldown change per level
1, // Item amount in loot 1, // Item amount in loot
C.cGold + C.Bold + "Length: " + C.Bold + C.cWhite + "(Spell Level x 10) + 5", C.cYellow + C.Bold + "Length: " + C.Bold + C.cWhite + "(Spell Level x 10) + 5",
"", "",
@ -251,6 +263,7 @@ public enum SpellType // ❤
"it even even burn away nearby blocks!"), "it even even burn away nearby blocks!"),
RainbowBeam(SpellElement.ATTACK, // Spell element RainbowBeam(SpellElement.ATTACK, // Spell element
WandElement.FIRE, // Wand element
"Rainbow Beam", // Spell name "Rainbow Beam", // Spell name
new ItemStack(Material.EMERALD), // Spell icon new ItemStack(Material.EMERALD), // Spell icon
SpellRainbowBeam.class, // Spell class SpellRainbowBeam.class, // Spell class
@ -261,9 +274,9 @@ public enum SpellType // ❤
1, // Cooldown change per level 1, // Cooldown change per level
10, // Item amount in loot 10, // Item amount in loot
C.cGold + C.Bold + "Damage: " + C.Bold + C.cWhite + "Spell Level + 2.5", C.cYellow + C.Bold + "Damage: " + C.Bold + C.cWhite + "Spell Level + 2.5",
C.cGold + C.Bold + "Range: " + C.Bold + C.cWhite + "80", C.cYellow + C.Bold + "Range: " + C.Bold + C.cWhite + "80",
"", "",
@ -278,6 +291,7 @@ public enum SpellType // ❤
"30 blocks by 0.2 damage per block!"), "30 blocks by 0.2 damage per block!"),
RainbowRoad(SpellElement.MISC, // Spell element RainbowRoad(SpellElement.MISC, // Spell element
WandElement.AIR, // Wand element
"Rainbow Road", // Spell name "Rainbow Road", // Spell name
new ItemStack(Material.SADDLE), // Spell icon new ItemStack(Material.SADDLE), // Spell icon
SpellRainbowRoad.class, // Spell class SpellRainbowRoad.class, // Spell class
@ -288,7 +302,7 @@ public enum SpellType // ❤
0, // Cooldown change per level 0, // Cooldown change per level
3, // Item amount in loot 3, // Item amount in loot
C.cGold + C.Bold + "Length: " + C.Bold + C.cWhite + "Spell Level x 10", C.cYellow + C.Bold + "Length: " + C.Bold + C.cWhite + "Spell Level x 10",
"", "",
@ -297,6 +311,7 @@ public enum SpellType // ❤
"of rainbows for thee to walk on!"), "of rainbows for thee to walk on!"),
Rumble(SpellElement.ATTACK, // Spell element Rumble(SpellElement.ATTACK, // Spell element
WandElement.EARTH, // Wand element
"Rumble", // Spell name "Rumble", // Spell name
new ItemStack(Material.PUMPKIN_SEEDS), // Spell icon new ItemStack(Material.PUMPKIN_SEEDS), // Spell icon
SpellRumble.class, // Spell class SpellRumble.class, // Spell class
@ -307,13 +322,13 @@ public enum SpellType // ❤
-1, // Cooldown change per level -1, // Cooldown change per level
10, // Item amount in loot 10, // Item amount in loot
C.cGold + C.Bold + "Damage: " + C.Bold + C.cWhite + "Spell Level + 2", C.cYellow + C.Bold + "Damage: " + C.Bold + C.cWhite + "Spell Level + 2",
C.cGold + C.Bold + "Explosion Damage: " + C.Bold + C.cWhite + "Spell Level / 4", C.cYellow + C.Bold + "Explosion Damage: " + C.Bold + C.cWhite + "Spell Level / 4",
C.cGold + C.Bold + "Range: " + C.Bold + C.cWhite + "Spell Level x 10", C.cYellow + C.Bold + "Range: " + C.Bold + C.cWhite + "Spell Level x 10",
C.cGold + C.Bold + "Slowness Level: " + C.Bold + C.cWhite + "Spell Level", C.cYellow + C.Bold + "Slowness Level: " + C.Bold + C.cWhite + "Spell Level",
"", "",
@ -326,6 +341,7 @@ public enum SpellType // ❤
"Effected players lose their footing!"), "Effected players lose their footing!"),
SpectralArrow(SpellElement.ATTACK, // Spell element SpectralArrow(SpellElement.ATTACK, // Spell element
WandElement.DEATH, // Wand element
"Spectral Arrow", // Spell name "Spectral Arrow", // Spell name
new ItemStack(Material.ENCHANTED_BOOK), // Spell icon new ItemStack(Material.ENCHANTED_BOOK), // Spell icon
SpellSpectralArrow.class, // Spell class SpellSpectralArrow.class, // Spell class
@ -336,7 +352,7 @@ public enum SpellType // ❤
-2, // Cooldown change per level -2, // Cooldown change per level
3, // Item amount in loot 3, // Item amount in loot
C.cGold + C.Bold + "Damage: " + C.Bold + C.cWhite + "(Blocks / (7 - Spell Level)) + 3", C.cYellow + C.Bold + "Damage: " + C.Bold + C.cWhite + "(Blocks / (7 - Spell Level)) + 3",
"", "",
@ -345,6 +361,7 @@ public enum SpellType // ❤
"Further the distance, higher the damage!"), "Further the distance, higher the damage!"),
SpeedBoost(SpellElement.SUPPORT, // Spell element SpeedBoost(SpellElement.SUPPORT, // Spell element
WandElement.LIFE, // Wand element
"Speed Boost", // Spell name "Speed Boost", // Spell name
new ItemStack(Material.BOOK), // Spell icon new ItemStack(Material.BOOK), // Spell icon
SpellSpeedBoost.class, // Spell class SpellSpeedBoost.class, // Spell class
@ -355,15 +372,16 @@ public enum SpellType // ❤
0, // Cooldown change per level 0, // Cooldown change per level
3, // Item amount in loot 3, // Item amount in loot
C.cGold + C.Bold + "Length: " + C.Bold + C.cWhite + "20 seconds", C.cYellow + C.Bold + "Length: " + C.Bold + C.cWhite + "20 seconds",
C.cGold + C.Bold + "Strength: " + C.Bold + C.cWhite + "Spell Level", C.cYellow + C.Bold + "Strength: " + C.Bold + C.cWhite + "Spell Level",
"", "",
"Gain a speed potion effect to outrun your enemies"), "Gain a speed potion effect to outrun your enemies"),
SummonWolves(SpellElement.ATTACK, // Spell element SummonWolves(SpellElement.ATTACK, // Spell element
WandElement.LIFE, // Wand element
"Summon Wolves", // Spell name "Summon Wolves", // Spell name
new ItemStack(Material.MILK_BUCKET), // Spell icon new ItemStack(Material.MILK_BUCKET), // Spell icon
SpellSummonWolves.class, // Spell class SpellSummonWolves.class, // Spell class
@ -374,7 +392,7 @@ public enum SpellType // ❤
0, // Cooldown change per level 0, // Cooldown change per level
8, // Item amount in loot 8, // Item amount in loot
C.cGold + C.Bold + "Wolves: " + C.Bold + C.cWhite + "Spell Level + 2", C.cYellow + C.Bold + "Wolves: " + C.Bold + C.cWhite + "Spell Level + 2",
"", "",
@ -383,8 +401,9 @@ public enum SpellType // ❤
"They will fight for you and after 30 seconds, will disappear"), "They will fight for you and after 30 seconds, will disappear"),
TrapRune(SpellElement.MISC, // Spell element TrapRune(SpellElement.MISC, // Spell element
WandElement.DEATH, // Wand element
"Trap Rune", // Spell name "Trap Rune", // Spell name
new ItemStack(Material.BREWING_STAND_ITEM), // Spell icon new ItemStack(Material.SHEARS), // Spell icon
SpellTrapRune.class, // Spell class SpellTrapRune.class, // Spell class
3, // Spell max level 3, // Spell max level
50, // Mana cost 50, // Mana cost
@ -393,11 +412,11 @@ public enum SpellType // ❤
-5, // Cooldown change per level -5, // Cooldown change per level
3, // Item amount in loot 3, // Item amount in loot
C.cGold + C.Bold + "Damage: " + C.Bold + C.cWhite + "(Spell Level x 2) + 3", C.cYellow + C.Bold + "Damage: " + C.Bold + C.cWhite + "(Spell Level x 2) + 3",
C.cGold + C.Bold + "Range: " + C.Bold + C.cWhite + "(Spell Level x 4) + 12", C.cYellow + C.Bold + "Range: " + C.Bold + C.cWhite + "(Spell Level x 4) + 12",
C.cGold + C.Bold + "Rune Size: " + C.Bold + C.cWhite + "Spell Level", C.cYellow + C.Bold + "Rune Size: " + C.Bold + C.cWhite + "Spell Level",
"", "",
@ -406,6 +425,7 @@ public enum SpellType // ❤
"The rune takes 5 seconds to prepare and will damage even you!"), "The rune takes 5 seconds to prepare and will damage even you!"),
WebShot(SpellElement.ATTACK, // Spell element WebShot(SpellElement.ATTACK, // Spell element
WandElement.DEATH, // Wand element
"Web Shot", // Spell name "Web Shot", // Spell name
new ItemStack(Material.SPIDER_EYE), // Spell icon new ItemStack(Material.SPIDER_EYE), // Spell icon
SpellWebShot.class, // Spell class SpellWebShot.class, // Spell class
@ -416,15 +436,16 @@ public enum SpellType // ❤
0, // Cooldown change per level 0, // Cooldown change per level
3, // Item amount in loot 3, // Item amount in loot
C.cGold + C.Bold + "Damage: " + C.Bold + C.cWhite + "1 heart", C.cYellow + C.Bold + "Damage: " + C.Bold + C.cWhite + "1 heart",
C.cGold + C.Bold + "Webs: " + C.Bold + C.cWhite + "Spell Level x 2", C.cYellow + C.Bold + "Webs: " + C.Bold + C.cWhite + "Spell Level x 2",
"", "",
"Shoot webs just like your favorite hero!"), "Shoot webs just like your favorite hero!"),
WizardsCompass(SpellElement.MISC, // Spell element WizardsCompass(SpellElement.MISC, // Spell element
WandElement.LIFE, // Wand element
"Wizard's Compass", // Spell name "Wizard's Compass", // Spell name
new ItemStack(Material.SUGAR), // Spell icon new ItemStack(Material.SUGAR), // Spell icon
SpellWizardsCompass.class, // Spell class SpellWizardsCompass.class, // Spell class
@ -500,6 +521,35 @@ public enum SpellType // ❤
} }
} }
public enum WandElement
{
AIR(Material.IRON_HOE),
DEATH(Material.FERMENTED_SPIDER_EYE),
EARTH(Material.STONE_HOE),
FIRE(Material.GOLD_HOE),
ICE(Material.DIAMOND_HOE),
LIFE(Material.WOOD_HOE),
NORMAL(Material.BLAZE_ROD);
private Material _material;
private WandElement(Material material)
{
_material = material;
}
public Material getMaterial()
{
return _material;
}
}
static static
{ {
for (SpellType spell : values()) for (SpellType spell : values())
@ -559,10 +609,13 @@ public enum SpellType // ❤
private int _spellCost; private int _spellCost;
private String _spellName; private String _spellName;
private SpellElement _type; private SpellElement _type;
private WandElement _wandElement;
private SpellType(SpellElement type, String spellName, ItemStack spellItem, Class<? extends Spell> spell, int maxLevel, private SpellType(SpellElement type, WandElement wandElement, String spellName, ItemStack spellItem,
int spellCost, int spellCooldown, int manaChangePerLevel, int cooldownChangePerLevel, int itemAmount, String... desc) Class<? extends Spell> spell, int maxLevel, int spellCost, int spellCooldown, int manaChangePerLevel,
int cooldownChangePerLevel, int itemAmount, String... desc)
{ {
_wandElement = wandElement;
_maxLevel = maxLevel; _maxLevel = maxLevel;
_item = spellItem; _item = spellItem;
_desc = desc; _desc = desc;
@ -663,6 +716,11 @@ public enum SpellType // ❤
return _spellName; return _spellName;
} }
public WandElement getWandType()
{
return _wandElement;
}
public ItemStack makeSpell(Wizards wizards, ItemStack item) public ItemStack makeSpell(Wizards wizards, ItemStack item)
{ {
ItemBuilder builder = new ItemBuilder(item); ItemBuilder builder = new ItemBuilder(item);

View File

@ -20,93 +20,93 @@ import org.bukkit.plugin.java.JavaPlugin;
public class WizardSpellMenu extends MiniPlugin public class WizardSpellMenu extends MiniPlugin
{ {
private Wizards _wizards; private Wizards _wizards;
private WizardSpellMenuShop _wizardShop; private WizardSpellMenuShop _wizardShop;
private ItemStack _wizardSpells = new ItemBuilder(Material.ENCHANTED_BOOK).setTitle(C.cGold + "Wizard Spells") private ItemStack _wizardSpells = new ItemBuilder(Material.ENCHANTED_BOOK).setTitle(C.cGold + "Wizard Spells")
.addLore(C.cGray + "Right click with this to view the spells").build(); .addLore(C.cGray + "Right click with this to view the spells").build();
public WizardSpellMenu(String moduleName, JavaPlugin plugin, Wizards wizards) public WizardSpellMenu(String moduleName, JavaPlugin plugin, Wizards wizards)
{ {
super("Wizard Spell Menu", plugin); super("Wizard Spell Menu", plugin);
_wizardShop = new WizardSpellMenuShop(this, wizards.getArcadeManager().GetClients(), wizards.getArcadeManager() _wizardShop = new WizardSpellMenuShop(this, wizards.getArcadeManager().GetClients(), wizards.getArcadeManager()
.GetDonation(), wizards); .GetDonation(), wizards);
_wizards = wizards; _wizards = wizards;
} }
@EventHandler @EventHandler
public void onJoin(PlayerJoinEvent event) public void onJoin(PlayerJoinEvent event)
{ {
if (_wizards.GetState() == GameState.Recruit || _wizards.GetState() == GameState.Live) if (_wizards.GetState() == GameState.Recruit || _wizards.GetState() == GameState.Live)
{ {
event.getPlayer().getInventory().addItem(_wizardSpells); event.getPlayer().getInventory().addItem(_wizardSpells);
} }
} }
@EventHandler @EventHandler
public void onDeath(final PlayerDeathEvent event) public void onDeath(final PlayerDeathEvent event)
{ {
Bukkit.getScheduler().scheduleSyncDelayedTask(_plugin, new Runnable() Bukkit.getScheduler().scheduleSyncDelayedTask(_plugin, new Runnable()
{ {
public void run() public void run()
{ {
if (_wizards.IsLive()) if (_wizards.IsLive())
{ {
event.getEntity().getInventory().addItem(_wizardSpells); event.getEntity().getInventory().addItem(_wizardSpells);
} }
} }
}); });
} }
@EventHandler @EventHandler
public void onJoin(GameStateChangeEvent event) public void onJoin(GameStateChangeEvent event)
{ {
if (event.GetState() == GameState.Recruit) if (event.GetState() == GameState.Recruit)
{ {
for (Player player : Bukkit.getOnlinePlayers()) for (Player player : Bukkit.getOnlinePlayers())
{ {
player.getInventory().addItem(_wizardSpells); player.getInventory().addItem(_wizardSpells);
} }
} }
} }
@EventHandler @EventHandler
public void onInteract(PlayerInteractEvent event) public void onInteract(PlayerInteractEvent event)
{ {
if (event.getAction() != Action.PHYSICAL && (!_wizards.IsLive() || !_wizards.IsAlive(event.getPlayer()))) if (event.getAction() != Action.PHYSICAL && (!_wizards.IsLive() || !_wizards.IsAlive(event.getPlayer())))
{ {
ItemStack item = event.getItem(); ItemStack item = event.getItem();
if (item != null && item.isSimilar(_wizardSpells)) if (item != null && item.isSimilar(_wizardSpells))
{ {
_wizardShop.attemptShopOpen(event.getPlayer()); _wizardShop.attemptShopOpen(event.getPlayer());
} }
} }
if (_wizards.IsLive() && _wizards.IsAlive(event.getPlayer())) if (_wizards.IsLive() && _wizards.IsAlive(event.getPlayer()))
{ {
ItemStack item = event.getItem(); ItemStack item = event.getItem();
if (item != null && item.getType() == Material.BLAZE_ROD)
{
Player p = event.getPlayer(); if (item != null && item.getType() != Material.STAINED_GLASS_PANE)
{
Player p = event.getPlayer();
if (event.getAction().name().contains("RIGHT")) if (event.getAction().name().contains("RIGHT"))
{ {
if (p.getInventory().getHeldItemSlot() < 5) if (p.getInventory().getHeldItemSlot() < 5)
{ {
if (event.getClickedBlock() == null || !(event.getClickedBlock().getState() instanceof InventoryHolder)) if (event.getClickedBlock() == null || !(event.getClickedBlock().getState() instanceof InventoryHolder))
{ {
_wizardShop.attemptShopOpen(p); _wizardShop.attemptShopOpen(p);
} }
} }
} }
} }
} }
} }
} }

View File

@ -312,8 +312,7 @@ public class Wizards extends SoloGame
private void addRandomItem(int amount, ItemStack item, int minAmount, int maxAmount) private void addRandomItem(int amount, ItemStack item, int minAmount, int maxAmount)
{ {
item.setAmount(minAmount); item.setAmount(minAmount);
HashMap.SimpleEntry entry = new HashMap.SimpleEntry(item, maxAmount HashMap.SimpleEntry entry = new HashMap.SimpleEntry(item, maxAmount - minAmount);
- minAmount);
for (int i = 0; i < amount; i++) for (int i = 0; i < amount; i++)
{ {
@ -447,6 +446,37 @@ public class Wizards extends SoloGame
} }
} }
public void changeWandsType(Player player, int oldSlot, int newSlot)
{
PlayerInventory inv = player.getInventory();
if (oldSlot >= 0 && oldSlot < 5)
{
SpellType spell = getWizard(player).getSpell(oldSlot);
if (spell != null)
{
ItemStack item = inv.getItem(oldSlot);
item.setType(spell.getSpellItem().getType());
inv.setItem(oldSlot, item);
}
}
if (newSlot >= 0 && newSlot < 5)
{
SpellType spell = getWizard(player).getSpell(newSlot);
if (spell != null)
{
ItemStack item = inv.getItem(newSlot);
item.setType(spell.getWandType().getMaterial());
inv.setItem(newSlot, item);
}
}
}
public void changeWandsTitles(Player player) public void changeWandsTitles(Player player)
{ {
PlayerInventory inv = player.getInventory(); PlayerInventory inv = player.getInventory();
@ -457,7 +487,7 @@ public class Wizards extends SoloGame
ItemStack item = inv.getItem(slot); ItemStack item = inv.getItem(slot);
SpellType type = wizard.getSpell(slot); SpellType type = wizard.getSpell(slot);
if (item != null && item.getType() == Material.BLAZE_ROD) if (item != null && item.getType() != Material.STAINED_GLASS_PANE)
{ {
String display; String display;
@ -744,7 +774,6 @@ public class Wizards extends SoloGame
{ {
HashSet<SpellType> spells = new HashSet<SpellType>(); HashSet<SpellType> spells = new HashSet<SpellType>();
ArrayList<ItemStack> itemsToDrop = new ArrayList<ItemStack>(); ArrayList<ItemStack> itemsToDrop = new ArrayList<ItemStack>();
ArrayList<ItemStack> normalItemsToDrop = UtilInv.getItems(player);
Wizard wizard = getWizard(player); Wizard wizard = getWizard(player);
int wandsHeld = 0; int wandsHeld = 0;
@ -767,23 +796,24 @@ public class Wizards extends SoloGame
} }
} }
Iterator<ItemStack> itel = normalItemsToDrop.iterator(); for (ItemStack item : UtilInv.getItems(player))
while (itel.hasNext())
{ {
ItemStack item = itel.next(); switch (item.getType())
if (item.getType() == Material.BLAZE_ROD)
{ {
case WOOD_HOE:
case STONE_HOE:
case GOLD_HOE:
case IRON_HOE:
case DIAMOND_HOE:
case BLAZE_ROD:
case STICK:
wandsHeld++; wandsHeld++;
itel.remove(); break;
} case STAINED_GLASS_PANE:
else if (item.getType() == Material.STAINED_GLASS_PANE) break;
{ default:
itel.remove();
}
else
{
player.getWorld().dropItemNaturally(player.getLocation(), item); player.getWorld().dropItemNaturally(player.getLocation(), item);
break;
} }
} }
@ -937,11 +967,10 @@ public class Wizards extends SoloGame
{ {
ItemStack item = player.getItemInHand(); ItemStack item = player.getItemInHand();
if (IsLive() && IsAlive(player) && item != null && item.getType() == Material.BLAZE_ROD if (IsLive() && IsAlive(player) && item != null && player.getInventory().getHeldItemSlot() < 5)
&& player.getInventory().getHeldItemSlot() < 5)
{ {
Wizard wizard = getWizard(player); Wizard wizard = getWizard(player);
SpellType spell = wizard.getSpell(player.getInventory().getHeldItemSlot()); SpellType spell = wizard.getSpell(player.getInventory().getHeldItemSlot());
if (spell != null) if (spell != null)
@ -1085,18 +1114,17 @@ public class Wizards extends SoloGame
if (IsAlive(p)) if (IsAlive(p))
{ {
dropSpells(p); dropSpells(p);
/*Iterator<ItemStack> itel = event.getDrops().iterator();
Iterator<ItemStack> itel = event.getDrops().iterator(); while (itel.hasNext())
{
ItemStack item = itel.next();
while (itel.hasNext()) if (item.getType() == Material.BLAZE_ROD || item.getType() == Material.STAINED_GLASS_PANE)
{ {
ItemStack item = itel.next(); itel.remove();
}
if (item.getType() == Material.BLAZE_ROD || item.getType() == Material.STAINED_GLASS_PANE) }*/
{
itel.remove();
}
}
} }
_wizards.remove(p.getName()); _wizards.remove(p.getName());
@ -1161,7 +1189,7 @@ public class Wizards extends SoloGame
_droppedWandsBooks.add(event.getEntity()); _droppedWandsBooks.add(event.getEntity());
} }
else if (item.getType() == Material.BOOK) else if (item.getType() == Material.BOOK || item.getType() == Material.STICK)
{ {
event.getEntity().remove(); event.getEntity().remove();
} }
@ -1257,20 +1285,9 @@ public class Wizards extends SoloGame
@EventHandler @EventHandler
public void onInteract(PlayerInteractEvent event) public void onInteract(PlayerInteractEvent event)
{ {
ItemStack item = event.getItem(); if (event.getAction().name().contains("LEFT"))
if (item != null)
{ {
onCastSpell(event.getPlayer(), event.getClickedBlock());
Player p = event.getPlayer();
if (event.getAction().name().contains("LEFT"))
{
if (item.getType() == Material.BLAZE_ROD)
{
onCastSpell(p, event.getClickedBlock());
}
}
} }
} }
@ -1439,22 +1456,29 @@ public class Wizards extends SoloGame
@EventHandler @EventHandler
public void onSwapItem(PlayerItemHeldEvent event) public void onSwapItem(PlayerItemHeldEvent event)
{ {
if (IsLive()) if (!IsLive())
{ {
Player p = event.getPlayer(); return;
}
Player p = event.getPlayer();
if (event.getNewSlot() >= 0 && event.getNewSlot() < 5) if (!_wizards.containsKey(p.getName()))
{ {
drawUtilTextBottom(p); return;
} }
else
{
// Get rid of the old wand message changeWandsType(p, event.getPreviousSlot(), event.getNewSlot());
if (event.getPreviousSlot() >= 0 && event.getPreviousSlot() < 5)
{ if (event.getNewSlot() >= 0 && event.getNewSlot() < 5)
UtilTextBottom.display(C.Bold, p); {
} drawUtilTextBottom(p);
}
else
{
// Get rid of the old wand message
if (event.getPreviousSlot() >= 0 && event.getPreviousSlot() < 5)
{
UtilTextBottom.display(C.Bold, p);
} }
} }
} }
@ -1475,10 +1499,21 @@ public class Wizards extends SoloGame
ItemStack result = recipe != null ? recipe.getResult() : null; ItemStack result = recipe != null ? recipe.getResult() : null;
if (result != null && (result.getType().name().contains("_SWORD") || result.getType().name().contains("_AXE"))) if (result != null)
{ {
event.getInventory().setResult(new ItemStack(Material.AIR)); if (result.getType().name().contains("_SWORD") || result.getType().name().contains("_AXE"))
UtilPlayer.message(event.getViewers().get(0), C.cRed + "You may not craft weaponsa"); {
event.getInventory().setResult(new ItemStack(Material.AIR));
UtilPlayer.message(event.getViewers().get(0), C.cRed + "You may not craft weapons");
}
else if (result.getType() == Material.STICK || result.getType() == Material.FERMENTED_SPIDER_EYE
|| result.getType().name().contains("_HOE"))
{
event.getInventory().setResult(new ItemStack(Material.AIR));
UtilPlayer.message(event.getViewers().get(0), C.cRed + "You may not craft this item");
}
} }
} }

View File

@ -20,7 +20,7 @@ public class KitMystic extends Kit
super(manager, "Mystic", KitAvailability.Free, new String[] super(manager, "Mystic", KitAvailability.Free, new String[]
{ {
"Mana regeneration increased by 10%" "Mana regeneration increased by 10%"
}, new Perk[0], EntityType.WITCH, new ItemStack(Material.BLAZE_ROD)); }, new Perk[0], EntityType.WITCH, new ItemStack(Material.WOOD_HOE));
} }
@Override @Override

View File

@ -20,7 +20,7 @@ public class KitSorcerer extends Kit
super(manager, "Sorcerer", KitAvailability.Free, new String[] super(manager, "Sorcerer", KitAvailability.Free, new String[]
{ {
"Start out with an extra wand" "Start out with an extra wand"
}, new Perk[0], EntityType.WITCH, new ItemStack(Material.BLAZE_ROD)); }, new Perk[0], EntityType.WITCH, new ItemStack(Material.STONE_HOE));
} }
@Override @Override

View File

@ -21,7 +21,7 @@ public class KitWitchDoctor extends Kit
super(manager, "Witch Doctor", KitAvailability.Free, new String[] super(manager, "Witch Doctor", KitAvailability.Free, new String[]
{ {
"Max mana increased to 150" "Max mana increased to 150"
}, new Perk[0], EntityType.WITCH, new ItemStack(Material.BLAZE_ROD)); }, new Perk[0], EntityType.WITCH, new ItemStack(Material.IRON_HOE));
this.setAchievementRequirements(new Achievement[] this.setAchievementRequirements(new Achievement[]
{ {