* @param character Creature
*/
@Override
public void onEvtSeeSpell(Skill skill, Creature character)
{
final RainbowYetiInstance actor = (RainbowYetiInstance) getActor();
final ClanHallMiniGameEvent miniGameEvent = actor.getEvent(ClanHallMiniGameEvent.class);
if (miniGameEvent == null)
{
return;
}
if (!character.isPlayer())
{
return;
}
final Player player = character.getPlayer();
CMGSiegeClanObject siegeClan = null;
final List<CMGSiegeClanObject> attackers = miniGameEvent.getObjects(SiegeEvent.ATTACKERS);
for (CMGSiegeClanObject $ : attackers)
{
if ($.isParticle(player))
{
siegeClan = $;
}
}
if (siegeClan == null)
{
return;
}
final int index = attackers.indexOf(siegeClan);
int warIndex = Integer.MIN_VALUE;
RainbowGourdInstance gourdInstance = null;
RainbowGourdInstance gourdInstance2 = null;
switch (skill.getId())
{
case 2240: // nectar
if (Rnd.chance(90))
{
gourdInstance = getGourd(index);
if (gourdInstance == null)
{
return;
}
gourdInstance.doDecrease(player);
}
else
{
actor.addMob(NpcUtils.spawnSingle(35592, actor.getX() + 10, actor.getY() + 10, actor.getZ(), 0));
}
break;
case 2241: // mineral water
warIndex = rndEx(attackers.size(), index);
if (warIndex == Integer.MIN_VALUE)