@Override public void affectCharState(MOB affected, CharState affectableState) { super.affectCharState(affected, affectableState); if (affected.location() != null) for (int i = 0; i < affected.location().numItems(); i++) { final Item I = affected.location().getItem(i); if ((I != null) && (I.ID().equals("DruidicMonument"))) affectableState.setMana(affectableState.getMana() + (affectableState.getMana() / 2)); } }
@Override public void affectCharState(MOB affected, CharState affectableState) { super.affectCharState(affected, affectableState); if (affected == null) return; final int hplevel = affectableState.getHitPoints() / affected.basePhyStats().level(); affectableState.setHitPoints( affectableState.getHitPoints() - (hplevel * (levelsDown * direction))); final int manalevel = affectableState.getMana() / affected.basePhyStats().level(); affectableState.setMana(affectableState.getMana() - (manalevel * (levelsDown * direction))); final int movelevel = affectableState.getMovement() / affected.basePhyStats().level(); affectableState.setMovement( affectableState.getMovement() - (movelevel * (levelsDown * direction))); }
public void affectCharState(MOB mob, CharState state) { super.affectCharState(mob, state); if (mob.baseCharStats().getCurrentClass().ID().equals(ID())) { Ability A = null; for (int a = 0; a < mob.numLearnedAbilities(); a++) { A = mob.fetchAbility(a); if ((A != null) && ((A.classificationCode() & Ability.ALL_ACODES) == Ability.ACODE_SPELL) && (!CMLib.ableMapper().getDefaultGain(ID(), false, A.ID()))) { int[] cost = A.usageCost(mob, true); int manaCost = cost[Ability.USAGEINDEX_MANA]; if (manaCost > 0) { if (state.getMana() < manaCost) { mob.delAbility(A); a--; } else state.setMana(state.getMana() - manaCost); } } } if (mob.curState().getMana() > state.getMana()) mob.curState().setMana(state.getMana()); } }
@Override public void affectCharState(MOB affected, CharState affectableStats) { if ((whom != null) && (song != null)) { final Hashtable<Integer, Integer> H = getSongBenefits(song); for (final Enumeration<Integer> e = H.keys(); e.hasMoreElements(); ) { final Integer I = e.nextElement(); final String[] chk = stuff[I.intValue()]; if ((chk != null) && (chk[1].startsWith("s"))) { int ticks = H.get(I).intValue(); if (ticks > 50) ticks = 50; if (ticks <= 0) ticks = 1; switch (chk[2].charAt(0)) { case 'h': affectableStats.setHunger( affectableStats.getHunger() + ticks + getXLEVELLevel(invoker())); break; case 't': affectableStats.setThirst( affectableStats.getThirst() + ticks + getXLEVELLevel(invoker())); break; case 'v': affectableStats.setMovement( affectableStats.getMovement() + ticks + getXLEVELLevel(invoker())); break; case 'm': affectableStats.setMana( affectableStats.getMana() + ticks + getXLEVELLevel(invoker())); break; case 'i': affectableStats.setHitPoints( affectableStats.getHitPoints() + ticks + getXLEVELLevel(invoker())); break; } } } } }