{
if (actor == null || !actor.isPlayer() || target == null || !target.isNpc())
{
return;
}
QuestState st = ((Player) actor).getQuestState(_10369_NoblesseTheTestOfSoul.class);
if (st == null)
return;
NpcInstance npc = (NpcInstance) target;
Player player = st.getPlayer();
int cond = st.getCond();
int npcId = npc.getNpcId();
switch (skill.getId())
{
case HelpingS:
if (npcId == Helping && cond == 16) //Aden Castle
{
ItemFunctions.removeItem(st.getPlayer(), HelpingSeed, 1L, true);
/*NpcInstance mob =*/ st.addSpawn(HelpingTree, 148216, 14856, -1393);
st.giveItems(Ashes, 1);
st.playSound("ItemSound.quest_middle");
st.setCond(17);
}
break;
case Trower:
if ((st.getCond() == 10) && (npcId == FlameFlower) && !npc.isDead())
{
st.giveItems(EnergyOfFire, 1);
st.playSound("ItemSound.quest_itemget");
npc.doDie(player);
}
if ((st.getQuestItemsCount(EnergyOfFire) >= 5))
{
st.playSound(SOUND_MIDDLE);
st.setCond(11);
}
}
}