def onSkillSee (self, npc, player, skill, targets, isPet): st = player.getQuestState(qn) if not st : return if Util.contains(targets, npc) and st.getInt("cond") == 1 and skill.getId() == 2630: st.playSound("ItemSound.quest_itemget") npcId = npc.getNpcId() if npcId in range(18684,18687): st.giveItems(red,1) elif npcId in range(18687,18690): st.giveItems(blue,1) elif npcId in range(18690,18693): st.giveItems(green,1) npc.doDie(player) return
def onKill(self,npc,player,isPet): partyMember = self.getRandomPartyMemberState(player,State.STARTED) if not partyMember : return st = partyMember.getQuestState(qn) if st : if st.getState() == State.STARTED : npcId = npc.getNpcId() cond = st.getInt("cond") id = st.getInt("id") st2 = partyMember.getQuestState("606_WarWithVarkaSilenos") if not partyMember.isAlliedWithVarka() : if (npcId in Varka_One) or (npcId in Varka_Two) or (npcId in Varka_Three) : item = 0 if cond <= 5 : if npcId in Varka_One : item,MAX,drop = One[cond] elif npcId in Varka_Two and cond > 1: item,MAX,drop = Two[cond] elif npcId in Varka_Three and cond > 2 : item,MAX,drop = Three[cond] if item != 0 : if st.getQuestItemsCount(drop) == MAX : item = 0 chance = Chance[npcId] #This is support for quest 606: War With Varka Silenos. Basically, if the person has both this quest and 606, then they only get one quest item, 50% chance for 606 quest item and 50% chance for this quest's item if st2 : if (st.getRandom(2) == 1 or item == 0) and npcId in Chance_mane.keys() : item = 57 MAX = 100 drop = Mane chance = Chance_mane[npcId] giveReward(st,item,chance,MAX,drop) elif id == 2 and item != 0 : giveReward(st,item,chance,MAX,drop) elif id == 2 and item != 0 : giveReward(st,item,chance,MAX,drop) elif npcId in Ketra_Orcs : party = partyMember.getParty() if party : for member in party.getPartyMembers().toArray() : if Util.checkIfInRange(5000, player, member, True) : pst = member.getQuestState(qn) if pst : decreaseAlliance(pst) else : decreaseAlliance(st) return