if st.getInt("cond") == 1 : if npcId == OMEN_BEAST and not st.getQuestItemsCount(ONYX_BEAST_EYE) : st.giveItems(ONYX_BEAST_EYE,1) elif npcId in [TAINTED_ZOMBIE,STINK_ZOMBIE] and not st.getQuestItemsCount(TAINT_STONE) : st.giveItems(TAINT_STONE,1) elif npcId in [LESSER_SUCCUBUS,LESSER_SUCCUBUS_TUREN,LESSER_SUCCUBUS_TILFO] and not st.getQuestItemsCount(SUCCUBUS_BLOOD) : st.giveItems(SUCCUBUS_BLOOD,1) if st.getQuestItemsCount(ONYX_BEAST_EYE) and st.getQuestItemsCount(TAINT_STONE) and st.getQuestItemsCount(SUCCUBUS_BLOOD) : st.set("cond","2") st.playSound("ItemSound.quest_middle") else : st.playSound("ItemSound.quest_itemget") return QUEST = Quest(3,qn,"Will the Seal be Broken?") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(TALLOTH) QUEST.addTalkId(TALLOTH) QUEST.addKillId(OMEN_BEAST) QUEST.addKillId(TAINTED_ZOMBIE) QUEST.addKillId(STINK_ZOMBIE) QUEST.addKillId(LESSER_SUCCUBUS) QUEST.addKillId(LESSER_SUCCUBUS_TUREN) QUEST.addKillId(LESSER_SUCCUBUS_TILFO)
htmltext = "Trade has been canceled." if htmltext != event: st.setState(COMPLETED) st.exitQuest(1) return htmltext def onTalk (Self,npc,st): npcId = npc.getNpcId() htmltext = "<html><head><body>I have nothing to say to you.</body></html>" st.set("cond","0") st.setState(STARTED) return "1.htm" QUEST = Quest(1005,"1005_unseal","Blacksmith") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(8126) STARTED.addTalkId(8126)
def onKill (self,npc,player): partyMember = self.getRandomPartyMemberState(player, STARTED) if not partyMember : return st = partyMember.getQuestState(qn) chance = CHANCE[npc.getNpcId()]*Config.RATE_DROP_QUEST numItems, chance = divmod(chance,MAX) if st.getRandom(MAX)<chance : numItems = numItems + 1 if numItems != 0 : st.giveItems(ANCIENT_SCROLL,int(numItems)) st.playSound("ItemSound.quest_itemget") return QUEST = Quest(385,qn,"Yoke of the Past") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) QUEST.setInitialState(CREATED) for npcId in range(31095,31126): if npcId in [31111,31112,31113]: continue QUEST.addTalkId(npcId) QUEST.addStartNpc(npcId) for mobs in range(21208,21256): QUEST.addKillId(mobs) STARTED.addQuestDrop(20986,ANCIENT_SCROLL,1) print "importing quests: 385: Yoke of the Past"
for i in DROP[npcId] : if i[0] <= chance < i[1] : qty = i[2] if qty : if count+qty>100 : qty=100-count if count+qty==100 : st.playSound("ItemSound.quest_middle") st.set("cond","2") else : st.playSound("ItemSound.quest_itemget") st.giveItems(PREDATORS_FANG,qty) return QUEST = Quest(266,"266_PleaOfPixies","Plea Of Pixies") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(12091) CREATED.addTalkId(12091) STARTING.addTalkId(12091) STARTED.addTalkId(12091) COMPLETED.addTalkId(12091) STARTED.addKillId(525) STARTED.addKillId(530) STARTED.addKillId(534)
if not st : return if st.getState() != STARTED : return npcId = npc.getNpcId() cond = st.getInt("cond") random = st.getRandom(100) if random<=CHANCE : st.giveItems(LIZARD_FANG,st.getRandom(5)+1) st.playSound("ItemSound.quest_itemget") if random<=CHANCE2 : st.giveItems(BARREL_OF_LEAGUE,1) st.set("cond","2") return QUEST = Quest(351,qn,"Black Swan") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30916) QUEST.addTalkId(30916) QUEST.addTalkId(30969) QUEST.addTalkId(30897) STARTED.addQuestDrop(30916,ORDER_OF_GOSTA,1) STARTED.addQuestDrop(30916,BARREL_OF_LEAGUE,1) STARTED.addQuestDrop(30916,LIZARD_FANG,1) QUEST.addKillId(20784) QUEST.addKillId(20785) QUEST.addKillId(21639)
st.giveItems(BONE_FRAGMENT6,1) st.playSound("ItemSound.quest_itemget") elif npcId == 20022 : if st.getInt("cond") == 16 and st.getQuestItemsCount(BONE_FRAGMENT7) == 0 : st.giveItems(BONE_FRAGMENT7,1) st.playSound("ItemSound.quest_itemget") elif npcId == 20100 : if st.getInt("cond") == 16 and st.getQuestItemsCount(BONE_FRAGMENT8) == 0 : st.giveItems(BONE_FRAGMENT8,1) st.playSound("ItemSound.quest_itemget") return QUEST = Quest(227,qn,"Test Of Reformer") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30118) QUEST.addTalkId(30118) for npcId in [30666,30667,30669,30670,30732,30668]: QUEST.addTalkId(npcId) for mobId in [20100,20102,20104,20404,20022,27099,27128,27130,27129,27132,27131]: QUEST.addKillId(mobId) for item in range(2822,2840)+[3037]: STARTED.addQuestDrop(20102,item,1)
htmltext = event if event == "0" : return InitialHtml for item in Items : if event == str(item[1]): htmltext = do_RequestedEvent(event, st, item[1], item[2], item[3], item[4], item[5], item[6]) if htmltext != event : st.setState(COMPLETED) st.exitQuest(1) return htmltext def onTalk (Self,npc,st): htmltext = "<html><head><body>I have nothing to say with you</body></html>" return InitialHtml ### Quest class and state definition QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc) CREATED = State('Start', QUEST) COMPLETED = State('Completed', QUEST) ### Quest initialization QUEST.setInitialState(CREATED) for item in NPC: ### Quest NPC starter initialization QUEST.addStartNpc(item) ### Quest NPC initialization CREATED.addTalkId(item) print "...done"
count = st.getQuestItemsCount(REMAINS) if count < REQUIRED and st.getRandom(DROP_MAX) < DROP_RATE: st.giveItems(REMAINS, 1) if count + 1 >= REQUIRED: st.playSound("ItemSound.quest_middle") st.set("cond", "2") else: st.playSound("ItemSound.quest_itemget") return # Quest class and state definition QUEST = Quest(QUEST_NUMBER, str(QUEST_NUMBER) + "_" + QUEST_NAME, QUEST_DESCRIPTION) CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) # Quest NPC starter initialization QUEST.addStartNpc(ORVEN) # Quest initialization CREATED.addTalkId(ORVEN) STARTED.addTalkId(ORVEN) for i in MOBS: STARTED.addKillId(i) STARTED.addQuestDrop(i, REMAINS, 1)
st = player.getQuestState(qn) if not st: return if st.getState() != STARTED: return count = st.getQuestItemsCount(BONE_FRAGMENT) if count < 10 and st.getRandom(10) > 7: st.giveItems(BONE_FRAGMENT, 1) if count == 9: st.playSound("ItemSound.quest_middle") st.set("cond", "2") else: st.playSound("ItemSound.quest_itemget") return QUEST = Quest(320, qn, "Bones Tell Future") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30359) QUEST.addTalkId(30359) QUEST.addKillId(20517) QUEST.addKillId(20518) STARTED.addQuestDrop(20517, BONE_FRAGMENT, 1)
count = st.getQuestItemsCount(SN_SCALE) if count < REQUIRED and st.getRandom(100) < DROP_RATE: st.giveItems(SN_SCALE, 1) if count + 1 == REQUIRED: st.playSound("ItemSound.quest_middle") st.set("cond", "2") else: st.playSound("ItemSound.quest_itemget") return # Quest class and state definition QUEST = Quest(QUEST_NUMBER, str(QUEST_NUMBER) + "_" + QUEST_NAME, QUEST_DESCRIPTION) CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) # Quest NPC starter initialization QUEST.addStartNpc(OLTLIN) # Quest initialization CREATED.addTalkId(OLTLIN) STARTED.addTalkId(OLTLIN) for i in MOBS: STARTED.addKillId(i) STARTED.addQuestDrop(i, SN_SCALE, 1)
if fwear.get("cond") == "7": htmltext = "30838-0.htm" else: st.exitQuest(1) else: st.exitQuest(1) elif id == STARTED: if npcId == 31520 and cond == 1: htmltext = "31520-0.htm" elif npcId == 30838 and cond == 2: htmltext = "30838-2.htm" elif npcId == 30838 and cond == 3: htmltext = "30838-4.htm" elif npcId == 30164 and cond == 4: htmltext = "30164-0.htm" elif npcId == 30838 and cond == 5: htmltext = "30838-6.htm" return htmltext QUEST = Quest(33, qn, "Make A Pair Of Dress Shoes") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30838) QUEST.addTalkId(30838) QUEST.addTalkId(30164) QUEST.addTalkId(31520)
if 66>st.getQuestItemsCount(DARKWING_BAT_FANG)>10 and st.getRandom(100) < 10 : st.addSpawn(27043) st.giveItems(VARANGKAS_PARASITE,1) else : if st.getQuestItemsCount(DARKWING_BAT_FANG) < 66 and st.getQuestItemsCount(VARANGKAS_PARASITE) : if st.getQuestItemsCount(DARKWING_BAT_FANG) < 65 : st.playSound("ItemSound.quest_itemget") else: st.playSound("ItemSound.quest_middle") st.set("cond","2") st.giveItems(DARKWING_BAT_FANG,5) st.takeItems(VARANGKAS_PARASITE,-1) return QUEST = Quest(275,qn,"Black Winged Spies") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30567) QUEST.addTalkId(30567) QUEST.addKillId(20316) QUEST.addKillId(27043) STARTED.addQuestDrop(20316,DARKWING_BAT_FANG,1) STARTED.addQuestDrop(20316,VARANGKAS_PARASITE,1)
partyMember = self.getRandomPartyMember(player, "14") if partyMember: st = partyMember.getQuestState(qn) chance = st.getRandom(100) if CHANCE_FOR_QUEST_ITEMS > chance and st.getQuestItemsCount( CRIMSON_MOSS) < 5: st.giveItems(CRIMSON_MOSS, 1) st.playSound("ItemSound.quest_itemget") if st.getQuestItemsCount(CRIMSON_MOSS) == 5: st.set("cond", "15") st.playSound("ItemSound.quest_middle") return QUEST = Quest(241, qn, "Possessor Of A Precious Soul - 1") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(TALIEN) QUEST.addTalkId(TALIEN) QUEST.addTalkId(STEDMIEL) QUEST.addTalkId(GABRIELLE) QUEST.addTalkId(GILMORE) QUEST.addTalkId(KANTABILON) QUEST.addTalkId(NOEL) QUEST.addTalkId(RAHORAKTI) QUEST.addTalkId(CARADINE) QUEST.addTalkId(VIRGIL)
htmltext = "<html><body>I can't supply you with another Giran Scroll of Escape. Sorry traveller.</body></html>" elif npcId == MIRABEL and cond == 1: htmltext = "30146-04.htm" elif id == STARTED: if npcId == ARIEL and cond: if st.getQuestItemsCount(ARIELS_RECOMMENDATION) == 0: htmltext = "30148-01.htm" else: htmltext = "30148-03.htm" elif npcId == ASTERIOS and cond == 2 and st.getQuestItemsCount( ARIELS_RECOMMENDATION) > 0: htmltext = "30154-01.htm" elif npcId == MIRABEL and cond == 3: htmltext = "30146-05.htm" return htmltext QUEST = Quest(7, qn, "A Trip Begins") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(MIRABEL) QUEST.addTalkId(MIRABEL) QUEST.addTalkId(ARIEL) QUEST.addTalkId(ASTERIOS) STARTED.addQuestDrop(MIRABEL, ARIELS_RECOMMENDATION, 1)
st.playSound("ItemSound.quest_finish") return htmltext def onKill (self,npc,st): count=st.getQuestItemsCount(BONE_FRAGMENT) if count<10 and st.getRandom(10)>7 : st.giveItems(BONE_FRAGMENT,1) if count == 9 : st.playSound("ItemSound.quest_middle") st.set("cond","2") else : st.playSound("ItemSound.quest_itemget") return QUEST = Quest(320,"320_BonesTellFuture","Bones Tell Future") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(7359) CREATED.addTalkId(7359) STARTING.addTalkId(7359) STARTED.addTalkId(7359) COMPLETED.addTalkId(7359) STARTED.addKillId(517) STARTED.addKillId(518)
def onKill(self, npc, player, isPet): objId = npc.getObjectId() npc.broadcastPacket( PlaySound(1, "BS02_D", 1, objId, npc.getX(), npc.getY(), npc.getZ())) # spawn the "Teleportation Cubic" for 15 minutes (to allow players to exit the lair) self.addSpawn(29055, 115203, 16620, 10078, 0, False, 900000) # "lock" baium for 5 days and 1 to 8 hours [i.e. 432,000,000 + 1*3,600,000 + random-less-than(8*3,600,000) millisecs] respawnTime = 435600000 + Rnd.get(8 * 3600000) self.isBaiumLocked = True self.startQuestTimer("baium_unlock", respawnTime, None, None) # also save the respawn time so that the info is maintained past reboots self.saveGlobalQuestVar("unlockDatetime", str(System.currentTimeMillis() + respawnTime)) # Quest class and state definition QUEST = baium(-1, "baium", "ai") CREATED = State('Start', QUEST) # Quest initialization QUEST.setInitialState(CREATED) # Quest NPC starter initialization QUEST.addStartNpc(STONE_BAIUM) QUEST.addStartNpc(ANGELIC_VORTEX) QUEST.addTalkId(STONE_BAIUM) QUEST.addTalkId(ANGELIC_VORTEX) QUEST.addKillId(LIVE_BAIUM) QUEST.addAttackId(LIVE_BAIUM)
maxcount*=4 giveItem(itemList[stoneRandom],maxcount,leader_st) elif len(itemList) : giveItem(itemList[0],maxcount,leader_st) else: if npcId == 27181: # Imperial Gravekeeper leader_st.getPcSpawn().addSpawn(30765,120000,["Curse of the gods on the one that defiles the property of the empire!"],60000) leader_st.set("ImpGraveKeeper","3") self.ImpGraveKepperStat = 1 elif npcId == 20668: leader_st.getPcSpawn().addSpawn(27179) return QUEST = Quest(503,qn,"Pursuit of Clan Ambition") CREATED = State('Start', QUEST) PROGRESS = State('Progress', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(NPC[3]) for npcId in NPC: QUEST.addTalkId(npcId) for mobId in DROPLIST.keys(): QUEST.addKillId(mobId) QUEST.addAttackId(27181) for i in range(3839,3848)+range(3866,3870): PROGRESS.addQuestDrop(27181,i,1)
if item == KALDIS_COIN: if cond == 2: if not st.getQuestItemsCount(item) and random < (chance - 10): st.giveItems(item, 1) st.playSound("ItemSound.quest_middle") st.set("cond", "3") elif random < chance: st.giveItems(item, 1) st.playSound("ItemSound.quest_itemget") return # Quest class and state definition QUEST = Quest(QUEST_NUMBER, str(QUEST_NUMBER) + "_" + QUEST_NAME, QUEST_DESCRIPTION) CREATED = State('Start', QUEST) SOLO = State('Solo', QUEST) PARTY = State('Party', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) # Quest NPC starter initialization QUEST.addStartNpc(SORINT) # Quest initialization for npc in [ SORINT, BERNARD, PAGE, HAGGER, STAN, RALFORD, FERRIS, COLLOB, PANO, DUNING, LORAIN ]: QUEST.addTalkId(npc)
st.giveItems(CHAPTER_OF_WIND, 1) st.playSound("ItemSound.quest_itemget") elif chance in range(75, 90) and st.getQuestItemsCount(CHAPTER_OF_EARTH) == 0: st.giveItems(CHAPTER_OF_EARTH, 1) st.playSound("ItemSound.quest_itemget") if ( st.getQuestItemsCount(CHAPTER_OF_FIRE) and st.getQuestItemsCount(CHAPTER_OF_WATER) and st.getQuestItemsCount(CHAPTER_OF_WIND) and st.getQuestItemsCount(CHAPTER_OF_EARTH) ): st.playSound("ItemSound.quest_middle") return QUEST = Quest(370, "370_AWisemanSowsSeeds", "A Wiseman Sows Seeds") CREATED = State("Start", QUEST) STARTED = State("Started", QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(CASIAN) CREATED.addTalkId(CASIAN) STARTED.addTalkId(CASIAN) for i in MOBS: STARTED.addKillId(i) for i in range(5917, 5921): STARTED.addQuestDrop(CASIAN, i, 1) print "importing quests: 370: A Wiseman Sows Seeds"
st = player.getQuestState(qn) if not st: return if st.getState() != STARTED: return if st.getQuestItemsCount(BLACK_WOLF_PELT) < 40: if st.getQuestItemsCount(BLACK_WOLF_PELT) < 39: st.playSound("ItemSound.quest_itemget") else: st.playSound("ItemSound.quest_middle") st.set("cond", "2") st.giveItems(BLACK_WOLF_PELT, 1) return QUEST = Quest(291, qn, "Red Bonnets Revenge") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30553) QUEST.addTalkId(30553) QUEST.addKillId(20317) STARTED.addQuestDrop(20317, BLACK_WOLF_PELT, 1) print "importing quests: 291: Red Bonnets Revenge"
if st.getState() != STARTED : return npcId = npc.getNpcId() if npcId == 20311 : chance = 90 if npcId == 20312 : chance = 87 if npcId == 20313 : chance = 77 if st.getRandom(100) <= chance : st.giveItems(BLACK_SOULSTONE,1) else: st.giveItems(RED_SOULSTONE,1) st.playSound("ItemSound.quest_itemget") return QUEST = Quest(273,qn,"Invaders Of Holyland") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30566) QUEST.addTalkId(30566) QUEST.addKillId(20311) QUEST.addKillId(20312) QUEST.addKillId(20313) STARTED.addQuestDrop(20311,BLACK_SOULSTONE,1) STARTED.addQuestDrop(20313,RED_SOULSTONE,1)
htmltext = "7350-05.htm" elif npcId == 7255: if int(st.get("cond")) == 1 and st.getQuestItemsCount( COLLETTE_LETTER): htmltext = "7255-01.htm" elif int(st.get("cond")) == 2 and st.getQuestItemsCount( NORMANS_LETTER): htmltext = "7255-05.htm" elif npcId == 7210 and int( st.get("cond")) == 2 and st.getQuestItemsCount(NORMANS_LETTER): htmltext = "7210-01.htm" return htmltext QUEST = Quest(167, "167_DwarvenKinship", "Dwarven Kinship") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(7350) CREATED.addTalkId(7350) COMPLETED.addTalkId(7350) STARTED.addTalkId(7210) STARTED.addTalkId(7255) STARTED.addTalkId(7350) STARTED.addQuestDrop(7350, COLLETTE_LETTER, 1) STARTED.addQuestDrop(7255, NORMANS_LETTER, 1)
def onKill (self,npc,player): st = player.getQuestState(qn) if not st : return if st.getState() != STARTED : return item,chance=DROPLIST[npc.getNpcId()] if st.getRandom(100)<chance : st.giveItems(item,1) st.playSound("ItemSound.quest_itemget") return QUEST = Quest(326,qn,"Vanquish Remnants") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30435) QUEST.addTalkId(30435) QUEST.addKillId(20436) QUEST.addKillId(20437) QUEST.addKillId(20438) QUEST.addKillId(20439) QUEST.addKillId(20053) QUEST.addKillId(20058) QUEST.addKillId(20061) QUEST.addKillId(20063)
if st: if st.getState() == STARTED: count = st.getQuestItemsCount(ORC_GOODS) if st.getInt("cond") == 1 and count < 120: chance = DROP_CHANCE * Config.RATE_DROP_QUEST numItems, chance = divmod(chance, 100) if st.getRandom(100) < chance: numItems += 1 if numItems: if count + numItems >= 120: numItems = 120 - count st.playSound("ItemSound.quest_middle") st.set("cond", "2") else: st.playSound("ItemSound.quest_itemget") st.giveItems(ORC_GOODS, int(numItems)) return QUEST = Quest(644, qn, "Grave Robber Annihilation") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(KARUDA) QUEST.addTalkId(KARUDA) for i in MOBS: QUEST.addKillId(i) STARTED.addQuestDrop(KARUDA, ORC_GOODS, 1)
if not st : return if st.getState() != STARTED : return count=st.getQuestItemsCount(BONE_FRAGMENT) if count<10 and st.getRandom(10)>7 : st.giveItems(BONE_FRAGMENT,1) if count == 9 : st.playSound("ItemSound.quest_middle") st.set("cond","2") else : st.playSound("ItemSound.quest_itemget") return QUEST = Quest(320,qn,"Bones Tell Future") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30359) QUEST.addTalkId(30359) QUEST.addKillId(20517) QUEST.addKillId(20518) STARTED.addQuestDrop(20517,BONE_FRAGMENT,1) print "importing quests: 320: Bones Tell Future"
else: st.playSound("ItemSound.quest_itemget") elif npcId == ROTTING_TREE and herb < 50: st.giveItems(HERBIBOROUS_SPORE, 1) if herb == 49: if carn >= 50: st.playSound("ItemSound.quest_middle") st.set("cond", "3") else: st.playSound("ItemSound.quest_middle") st.set("cond", "2") else: st.playSound("ItemSound.quest_itemget") return QUEST = Quest(356, qn, "Dig Up The Sea Of Spores") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(GAUEN) QUEST.addTalkId(GAUEN) QUEST.addKillId(SPORE_ZOMBIE) QUEST.addKillId(ROTTING_TREE) STARTED.addQuestDrop(GAUEN, CARNIVORE_SPORE, 1) STARTED.addQuestDrop(GAUEN, HERBIBOROUS_SPORE, 1)
st.playSound("Itemsound.quest_itemget") else: st.giveItems(itemid,1) if count==maxcount-1: st.playSound("ItemSound.quest_middle") st.set("cond",str(cond+1)) if npcId == 27093: st.giveItems(STRANGE_MAP,1) else: st.playSound("Itemsound.quest_itemget") if npcId==20781 and random<30 and count<maxcount: st.addSpawn(27094,npc.getX(),npc.getY(),npc.getZ(),npc.getHeading(),True,300000) return QUEST = Quest(225,qn,"Test Of Searcher") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30690) for npcId in NPC: QUEST.addTalkId(npcId) for mobId in MOB: QUEST.addKillId(mobId) for item in range(2784,2809): STARTED.addQuestDrop(30690,item,1)
if event == "0": htmltext = "Trade has been canceled." if htmltext != event: st.setState(COMPLETED) st.exitQuest(1) return htmltext def onTalk(Self, npc, st): npcId = npc.getNpcId() htmltext = "<html><head><body>I have nothing to say to you.</body></html>" st.set("cond", "0") st.setState(STARTED) return "1.htm" QUEST = Quest(1004, "1004_create", "Blacksmith") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) for npcId in SMITHS: QUEST.addStartNpc(npcId) STARTED.addTalkId(npcId) print "importing blacksmith data: 1004_create"
if st.getQuestItemsCount(SEED_OF_VERDURE_ID) and st.getQuestItemsCount(BREATH_OF_WINDS_ID) : st.set("cond","3") st.playSound("Itemsound.quest_middle") else : st.playSound("Itemsound.quest_itemget") elif npcId == 20213 : # Condition 19 Porta st.set("cond","20") st.playSound("ItemSound.quest_middle") else: st.playSound("Itemsound.quest_itemget") return QUEST = Quest(217,qn,"Testimony Of Trust") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30191) QUEST.addTalkId(30191) QUEST.addTalkId(30031) QUEST.addTalkId(30154) QUEST.addTalkId(30358) QUEST.addTalkId(30464) QUEST.addTalkId(30515) QUEST.addTalkId(30531) QUEST.addTalkId(30565)
for i in DROP[npcId]: if i[0] <= chance < i[1]: qty = i[2] if count + qty > 100: qty = 100 - count if count + qty == 100: st.playSound("ItemSound.quest_middle") st.set("cond", "2") else: st.playSound("ItemSound.quest_itemget") st.giveItems(BAT_FANG, qty) return QUEST = Quest(294, "294_CovertBusiness", "Covert Business") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(7534) CREATED.addTalkId(7534) STARTING.addTalkId(7534) STARTED.addTalkId(7534) COMPLETED.addTalkId(7534) STARTED.addKillId(370) STARTED.addKillId(480)
htmltext = "7095-0a.htm" st.exitQuest(1) elif cond == 1: if not st.getQuestItemsCount(TREASURE_CHEST): htmltext = "7095-2.htm" else: htmltext = "7095-4.htm" return htmltext def onKill(self, npc, st): chance = st.getRandom(100) if chance < CHANCE_OF_DROP: st.giveItems(TREASURE_CHEST, 1) st.playSound("ItemSound.quest_itemget") return QUEST = Quest(365, "365_DevilsLegacy", "Devil's Legacy") CREATED = State("Start", QUEST) STARTED = State("Started", QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(RANDOLF) CREATED.addTalkId(RANDOLF) STARTED.addTalkId(RANDOLF) for mob in MOBS: STARTED.addKillId(mob) STARTED.addQuestDrop(RANDOLF, TREASURE_CHEST, 1) print "importing quests: 365: Devil's Legacy"
st = partyMember.getQuestState(qn) if st: if st.getState() == STARTED: count = st.getQuestItemsCount(EYE_OF_DARKNESS) chance = CHANCE[npc.getNpcId()] * Config.RATE_DROP_QUEST numItems, chance = divmod(chance, 100) if st.getInt("cond") == 1: if st.getRandom(100) < chance: numItems = numItems + 1 if count + numItems >= 100: numItems = 100 - count st.playSound("ItemSound.quest_middle") st.set("cond", "2") else: st.playSound("ItemSound.quest_itemget") st.giveItems(EYE_OF_DARKNESS, int(numItems)) return QUEST = Quest(602, qn, "Shadow Of Light") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(EYE_OF_ARGOS) QUEST.addTalkId(EYE_OF_ARGOS) for i in MOBS: QUEST.addKillId(i) STARTED.addQuestDrop(EYE_OF_ARGOS, EYE_OF_DARKNESS, 1)
count = st.getQuestItemsCount(KASHA_WOLF_FANG) if count < 50 : if st.getRandom(100) <= 25 and count < 49 : st.giveItems(KASHA_WOLF_FANG,2) count += 2 else : st.giveItems(KASHA_WOLF_FANG,1) count += 1 if count >= 50 : st.playSound("ItemSound.quest_middle") st.set("cond","2") else: st.playSound("ItemSound.quest_itemget") return QUEST = Quest(271,qn,"Proof Of Valor") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) # kept just for backwards compatibility STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30577) QUEST.addTalkId(30577) QUEST.addKillId(20475) STARTED.addQuestDrop(20475,KASHA_WOLF_FANG,1) print "importing quests: 271: Proof Of Valor"
st = player.getQuestState(qn) if not st: return if st.getState() != STARTED: return if st.getInt("cond") == 1: numItems, chance = divmod(100 * Config.RATE_DROP_QUEST, 100) if st.getRandom(100) < chance: numItems = numItems + 1 count = st.getQuestItemsCount(RED_CRYSTALS_ID) if count + numItems >= 50: numItems = 50 - count if numItems != 0: st.playSound("ItemSound.quest_middle") st.set("cond", "2") else: st.playSound("ItemSound.quest_itemget") st.giveItems(RED_CRYSTALS_ID, int(numItems)) return QUEST = Quest(432, qn, "Birthday Party Song") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(31043) QUEST.addTalkId(31043) QUEST.addKillId(21103) STARTED.addQuestDrop(21103, RED_CRYSTALS_ID, 1)
else: st.playSound("ItemSound.quest_itemget") elif npcId == 456 : st.set("id","0") if int(st.get("cond")) == 1 : if st.getRandom(10)<4 and st.getQuestItemsCount(DARK_BEZOAR_ID)<13 : st.giveItems(DARK_BEZOAR_ID,1) if st.getQuestItemsCount(DARK_BEZOAR_ID) == 13 : st.playSound("ItemSound.quest_middle") else: st.playSound("ItemSound.quest_itemget") return QUEST = Quest(165,"165_WildHunt","Wild Hunt") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(7348) STARTING.addTalkId(7348) STARTED.addTalkId(7348) STARTED.addKillId(456) STARTED.addKillId(529) STARTED.addKillId(532) STARTED.addKillId(536)
if condition == 8 : if heart < 1 : st.giveItems(TYRANT_KINGPIN_HEART,1) st.playSound("ItemSound.quest_middle") elif npcId == TRISALIM_TARANTULA : if condition == 9 : if sacs < 3 : st.giveItems(TRISALIM_TARANTULAS_VENOM_SAC,1) if skulls == 3 : st.playSound("ItemSound.quest_middle") else : st.playSound("ItemSound.quest_itemget") return QUEST = Quest(422,qn,"Repent your Sins") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30981) QUEST.addTalkId(30981) QUEST.addTalkId(30668) QUEST.addTalkId(30597) QUEST.addTalkId(30612) QUEST.addTalkId(30718) QUEST.addTalkId(30300) QUEST.addKillId(SCAVENGER_WERERAT) QUEST.addKillId(TUREK_WARHOUND) QUEST.addKillId(TYRANT_KINGPIN)
def onKill (self, npc, player): st = player.getQuestState(qn) if st : if st.getState() == STARTED : count = st.getQuestItemsCount(NECROHEART) if st.getInt("cond")==1 and st.getRandom(100)<CHANCE and count<10 : st.giveItems(NECROHEART,1) if count == 9 : st.playSound("ItemSound.quest_middle") st.set("cond","2") else: st.playSound("ItemSound.quest_itemget") return QUEST = Quest(637,qn,"Through the Gate Once More") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(FLAURON) QUEST.addTalkId(FLAURON) for mob in range(21565,21568): QUEST.addKillId(mob) STARTED.addQuestDrop(FLAURON,NECROHEART,1) print "importing quests: 637: Through the Gate Once More"
count = st.getQuestItemsCount(item) if count < 65 and st.getRandom(DROP_MAX) < DROP_RATE: st.giveItems(item, 1) if count + 1 >= 65: st.playSound("ItemSound.quest_middle") st.unset(partyCond) else: st.playSound("ItemSound.quest_itemget") return # Quest class and state definition QUEST = Quest(QUEST_NUMBER, str(QUEST_NUMBER) + "_" + QUEST_NAME, QUEST_DESCRIPTION) CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) # Quest NPC starter initialization QUEST.addStartNpc(MANAKIA) # Quest initialization QUEST.addTalkId(MANAKIA) QUEST.addTalkId(TORAI) for i in DROPLIST.keys(): QUEST.addKillId(i)
if Rnd.get(2) : partyMember = partyMember2 st = partyMember.getQuestState(qn) if not st : return if st.getState() != STARTED : return count = st.getQuestItemsCount(SPINNERET) if count < 10 : st.giveItems(SPINNERET,1) if count == 9 : st.playSound("ItemSound.quest_middle") st.set("cond","5") else : st.playSound("ItemSound.quest_itemget") return QUEST = Quest(34,qn,"In Search of Clothes") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30088) QUEST.addTalkId(30088) QUEST.addTalkId(30165) QUEST.addTalkId(30294) QUEST.addKillId(20560) STARTED.addQuestDrop(20560,SPINNERET,1) print "importing quests: 34: In Search of Clothes"
st.playSound("ItemSound.quest_itemget") else: st.playSound("ItemSound.quest_middle") if st.getQuestItemsCount( GHOULS_SKIN_ID) == 10 and st.getQuestItemsCount( MEDUSAS_BLOOD_ID ) == 12 and st.getQuestItemsCount( FETTEREDSOULS_ICHOR_ID ) == 5 and st.getQuestItemsCount( ENCHT_GARGOYLES_NAIL_ID) == 5: st.set("cond", "29") return QUEST = Quest(214, qn, "Trial Of Scholar") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(NPC[0]) for npcId in NPC: for i in range(2674, 2721): QUEST.addTalkId(npcId) STARTED.addQuestDrop(npcId, i, 1) for mobId in MOBS: QUEST.addKillId(mobId)
elif npcId in [20093,20096,20098] : item = ORC_NECKLACE else : item = WEREWOLF_FANG if npcId == 20343 : chance = 4 elif npcId == 20342 : chance = 2 if st.getQuestItemsCount(GLUDIO_LORDS_MARK) : if st.getRandom(10)<chance : st.giveItems(item,1) st.playSound("ItemSound.quest_itemget") return QUEST = Quest(257,qn,"Guard Is Busy1") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30039) QUEST.addTalkId(30039) QUEST.addKillId(20130) QUEST.addKillId(20131) QUEST.addKillId(20132) QUEST.addKillId(20342) QUEST.addKillId(20343) QUEST.addKillId(20006) QUEST.addKillId(20093) QUEST.addKillId(20096)
st.giveItems(TALINS_RUBY_ID, 1) st.playSound("ItemSound.quest_itemget") elif st.getQuestItemsCount(TALINS_AQUAMARINE_ID) == 0: st.giveItems(TALINS_AQUAMARINE_ID, 1) st.playSound("ItemSound.quest_itemget") elif st.getQuestItemsCount(TALINS_AMETHYST_ID) == 0: st.giveItems(TALINS_AMETHYST_ID, 1) st.playSound("ItemSound.quest_itemget") elif st.getQuestItemsCount(TALINS_PERIDOT_ID) == 0: st.giveItems(TALINS_PERIDOT_ID, 1) st.playSound("ItemSound.quest_middle") return QUEST = Quest(218, qn, "Testimony of Life") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30460) QUEST.addTalkId(30460) QUEST.addTalkId(30154) QUEST.addTalkId(30300) QUEST.addTalkId(30371) QUEST.addTalkId(30375) QUEST.addTalkId(30419) QUEST.addTalkId(30655)
return htmltext def onKill (self,npc,player): st = player.getQuestState(qn) if not st : return if st.getState() != STARTED : return npcId = npc.getNpcId() cond = st.getInt("cond") if cond==1 : st.dropQuestItems(BEAR_SKIN,1,20,CHANCE,1) return QUEST = Quest(341,qn,"Hunting For Wild Beasts") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30078) QUEST.addTalkId(30078) STARTED.addQuestDrop(30078,BEAR_SKIN,1) QUEST.addKillId(20021) QUEST.addKillId(20203) QUEST.addKillId(20310) QUEST.addKillId(20335) print "importing quests: 341: Hunting For Wild Beasts"
st = player.getQuestState(qn) if st: if st.getState() == STARTED: npcId = npc.getNpcId() cond = st.getInt("cond") id = st.getInt("id") Red_Totem = st.getQuestItemsCount(Totem) if npcId in Ketra_Orcs: st.unset("id") st.unset("aggro") st.exitQuest(1) if Red_Totem: st.takeItems(Totem, -1) return QUEST = Quest(609, qn, "Magical Power of Water - Part 1") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(Wahkan) QUEST.addTalkId(Wahkan) QUEST.addTalkId(Asefa) QUEST.addTalkId(Udan_Box) STARTED.addQuestDrop(Udan_Box, Totem, 1) for mobId in Varka_Mobs: QUEST.addAttackId(mobId) for mobId in Ketra_Orcs: QUEST.addKillId(mobId)
def onKill (self,npc,st): count=st.getQuestItemsCount(MARAKU_WEREWOLF_HEAD) if count < 40 : if count < 39 : st.playSound("ItemSound.quest_itemget") else: st.playSound("ItemSound.quest_middle") st.set("cond","2") st.giveItems(MARAKU_WEREWOLF_HEAD,1) if st.getRandom(100) <= 5 : st.giveItems(MARAKU_WOLFMEN_TOTEM,1) return QUEST = Quest(274,"274_AgainstWolfMen","Against Wolf Men") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(7569) CREATED.addTalkId(7569) STARTING.addTalkId(7569) STARTED.addTalkId(7569) COMPLETED.addTalkId(7569) STARTED.addKillId(363) STARTED.addKillId(364)
return htmltext def onKill(self,npc,player,isPet): partyMember = self.getRandomPartyMember(player,"1") if not partyMember : return st = partyMember.getQuestState(qn) if st : if st.getState() == STARTED : count = st.getQuestItemsCount(BLOOD_OF_SAINT) if st.getInt("cond") == 1 and count < 300 : st.giveItems(BLOOD_OF_SAINT,1) if count == 299 : st.playSound("ItemSound.quest_middle") st.set("cond","2") else: st.playSound("ItemSound.quest_itemget") return QUEST = Quest(626,qn,"A Dark Twilight") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(31517) QUEST.addTalkId(31517) for mobs in range(21520,21541): QUEST.addKillId(mobs) STARTED.addQuestDrop(21520,BLOOD_OF_SAINT,1)
st.playSound("ItemSound.quest_middle") if part == 1: count = 0 for items in [GOLDEN_SEED1_ID, GOLDEN_SEED2_ID, GOLDEN_SEED3_ID]: count += st.getQuestItemsCount(items) if count > 2: st.set("cond", "5") else: st.giveItems(item, 1) st.playSound("ItemSound.quest_itemget") return QUEST = Quest(228, "228_TestOfMagus", "Test Of Magus") CREATED = State("Start", QUEST) STARTING = State("Starting", QUEST) STARTED = State("Started", QUEST) COMPLETED = State("Completed", QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(7629) STARTING.addTalkId(7629) for npcId in [7391, 7409, 7411, 7412, 7413, 7612, 7629]: STARTED.addTalkId(npcId) for mobId in [145, 157, 176, 230, 231, 232, 234, 5095, 5096, 5097, 5098, 553, 564, 565, 566]: STARTED.addKillId(mobId)
st.set("id", "0") if int(st.get( "cond")) and st.getQuestItemsCount(WANTED_BILL_ID) > 0: n = st.getRandom(4) if st.getQuestItemsCount(STOLEN_ITEM[n]) == 0: st.giveItems(STOLEN_ITEM[n], 1) if not HaveAllStolenItems(st): st.playSound("ItemSound.quest_itemget") else: st.playSound("ItemSound.quest_middle") st.set("cond", "6") return QUEST = Quest(403, "403_PathToRogue", "Path To Rogue") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(7379) STARTING.addTalkId(7379) STARTED.addTalkId(7379) STARTED.addTalkId(7425) STARTED.addKillId(5038) for StolenItemId in STOLEN_ITEM.keys():
return do_RequestEvent(event,st) def onTalk (Self,npc,st): npcId = npc.getNpcId() htmltext = "<html><head><body>I have nothing to say with you</body></html>" st.setState(STARTED) if InitialHtml == "onEvent" : return do_RequestEvent(str(npcId),st) elif InitialHtml != "" : return InitialHtml return htmltext ### Quest class and state definition QUEST = Quest(QuestId, str(QuestId) + "_" + QuestName, QuestDesc) CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) ### Quest initialization QUEST.setInitialState(CREATED) for item in NPC: ### Quest NPC starter initialization QUEST.addStartNpc(item) ### Quest NPC initialization STARTED.addTalkId(item) print ": Loaded " + str(len(Items)) + " item(s)"
st.get(var)) == value and random < chance and count < maxcount: st.giveItems(item, 1) if count == maxcount - 1: st.playSound("ItemSound.quest_middle") if newValue == 1 and st.getQuestItemsCount( RAGNA_ORC_HEAD_ID) and st.getQuestItemsCount( RAGNA_CHIEF_NOTICE_ID): st.set(var, "2") else: st.set(var, str(newValue)) else: st.playSound("ItemSound.quest_itemget") return QUEST = Quest(232, qn, "Test Of Lord") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(NPC[4]) for npcId in NPC: QUEST.addTalkId(npcId) for mobId in MOBS: QUEST.addKillId(mobId) for item in range(3391, 3417): STARTED.addQuestDrop(NPC[4], item, 1)
if npcId == 30533 and st.getInt("cond")==1 : htmltext = "30533-04.htm" elif npcId == 30520 and st.getInt("cond") == 3 : htmltext = "30520-04.htm" st.set("cond","4") elif npcId == 30520 and st.getInt("cond") : if st.getQuestItemsCount(VERY_EXPENSIVE_NECKLACE) == 0 : htmltext = "30520-01.htm" else : htmltext = "30520-03.htm" elif npcId == 30650 and st.getInt("cond")==2 : if st.getQuestItemsCount(VERY_EXPENSIVE_NECKLACE) : htmltext = "30650-01.htm" elif npcId == 30533 and st.getInt("cond")==4 : htmltext = "30533-05.htm" return htmltext QUEST = Quest(10,qn,"Into The World") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30533) QUEST.addTalkId(30533) QUEST.addTalkId(30520) QUEST.addTalkId(30650) STARTED.addQuestDrop(30520,VERY_EXPENSIVE_NECKLACE,1)
if st.getInt("cond") == 1 and count < 100: chance = DROP_CHANCE * Config.RATE_DROP_QUEST numItems, chance = divmod(chance, 100) if st.getRandom(100) < chance: numItems = numItems + 1 if numItems: if count + numItems >= 100: numItems = 100 - count st.playSound("ItemSound.quest_middle") st.set("cond", "2") else: st.playSound("ItemSound.quest_itemget") st.giveItems(PROOF_OF_AVENGER, int(numItems)) return QUEST = Quest(601, qn, "Watching Eyes") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(EYE_OF_ARGOS) QUEST.addTalkId(EYE_OF_ARGOS) for i in MOBS: QUEST.addKillId(i) STARTED.addQuestDrop(EYE_OF_ARGOS, PROOF_OF_AVENGER, 1) print "importing quests: 601: Watching Eyes"
if cond == 4: if st.getQuestItemsCount(OL_MAHUM_RUNESTONE_ID)+st.getQuestItemsCount(TUREK_RUNESTONE_ID)+st.getQuestItemsCount(ANT_RUNESTONE_ID)+st.getQuestItemsCount(TURAK_BUGBEAR_RUNESTONE_ID)==4 : st.set("cond",str(cond+1)) return elif cond == 16: if st.getQuestItemsCount(ABYSS_RUNESTONE1_ID)+st.getQuestItemsCount(ABYSS_RUNESTONE2_ID)+st.getQuestItemsCount(ABYSS_RUNESTONE3_ID)+st.getQuestItemsCount(ABYSS_RUNESTONE4_ID)==4: st.set("cond",str(cond+1)) return else: st.set("cond",str(cond+1)) else : st.playSound("Itemsound.quest_itemget") return QUEST = Quest(213,qn,"Trial Of Seeker") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(NPCS[0]) for npcId in NPCS: for i in range(2647,2674): QUEST.addTalkId(npcId) STARTED.addQuestDrop(npcId,i,1) for mobId in MOBS: QUEST.addKillId(mobId)
htmltext = "<html><body>You must be in Clan.</body></html" elif event == "9001-02.htm": htmltext = "9001-02.htm" return htmltext def __init__(self, id, name, descr): JQuest.__init__(self, id, name, descr) def onTalk(Self, npc, player): st = player.getQuestState(qn) npcId = npc.getNpcId() ClanLeader = st.getPlayer().isClanLeader() Clan = st.getPlayer().getClan() if npcId in NPC: st.set("cond", "0") st.setState(STARTED) return "9001-01.htm" QUEST = Quest(9001, qn, "village_master") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) for item in NPC: ### Quest NPC starter initialization QUEST.addStartNpc(item) ### Quest NPC initialization QUEST.addTalkId(item)
st.playSound("ItemSound.quest_finish") return htmltext def onKill (self,npc,st): count = st.getQuestItemsCount(WOLF_PELT) if count<40 : st.giveItems(WOLF_PELT,1) if count == 39 : st.playSound("ItemSound.quest_middle") st.set("cond","2") else: st.playSound("ItemSound.quest_itemget") return QUEST = Quest(258,"258_BringWolfPelt1","Bring Wolf Pelt1") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(7001) CREATED.addTalkId(7001) STARTING.addTalkId(7001) STARTED.addTalkId(7001) COMPLETED.addTalkId(7001) STARTED.addKillId(120) STARTED.addKillId(442)
elif npcId == 5056: st.set("id", "0") if int(st.get("cond")) and st.getQuestItemsCount( SPIRIT_NET_ID) == 1 and st.getQuestItemsCount( BOUND_DURKA_SPIRIT_ID) == 0: st.giveItems(BOUND_DURKA_SPIRIT_ID, 1) st.takeItems(SPIRIT_NET_ID, 1) st.takeItems(DURKA_PARASITE_ID, st.getQuestItemsCount(DURKA_PARASITE_ID)) st.playSound("ItemSound.quest_middle") st.set("cond", "10") return QUEST = Quest(416, "416_PathToOrcShaman", "Path To Orc Shaman") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(7585) STARTING.addTalkId(7585) STARTED.addTalkId(7502) STARTED.addTalkId(7585) STARTED.addTalkId(7592) STARTED.addTalkId(7593) STARTED.addKillId(335)
st.takeItems(LIENRIK_EGG1,-1) st.takeItems(LIENRIK_EGG2,-1) st.playSound("ItemSound.quest_itemget") return htmltext def onKill (self,npc,st): npcId = npc.getNpcId() random = st.getRandom(100) if random<=CHANCE : st.giveItems(LIENRIK_EGG1,1) if random<=CHANCE2 : st.giveItems(LIENRIK_EGG2,1) return QUEST = Quest(352,"352_HelpRoodRaiseANewPet","Help Rood Raise A New Pet") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(8067) CREATED.addTalkId(8067) STARTED.addTalkId(8067) STARTED.addQuestDrop(8067,LIENRIK_EGG1,1) STARTED.addQuestDrop(8067,LIENRIK_EGG2,1) STARTED.addKillId(786) STARTED.addKillId(787) print "importing quests: 352: Help Rood Raise A New Pet"
htmltext = "7094-01.htm" elif npcId == 7094 and int(st.get("cond"))==2 : htmltext = "7094-03.htm" elif npcId == 7090 and int(st.get("cond"))==3 : htmltext = "7090-01.htm" elif npcId == 7090 and int(st.get("cond"))==4 : htmltext = "7090-03.htm" elif npcId == 7116 and int(st.get("cond"))==5 : htmltext = "7116-01.htm" elif npcId == 7116 and int(st.get("cond"))==6 : htmltext = "7116-03.htm" return htmltext QUEST = Quest(46,"46_OnceMoreInTheArmsOfTheMotherTree","Once More In The Arms Of The Mother Tree") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(7097) CREATED.addTalkId(7097) COMPLETED.addTalkId(7097) STARTED.addTalkId(7097) STARTED.addTalkId(7094) STARTED.addTalkId(7090) STARTED.addTalkId(7116) STARTED.addQuestDrop(7097,GALLADUCCIS_ORDER_DOCUMENT_ID_1,1)
htmltext = "7873-5.htm" return htmltext def onKill (self,npc,st): st.giveItems(SUPPLY_ITEM,1) if st.getRandom(10) == 1 : # % chance is custom st.giveItems(SUSPICIOUS_DOCUMENT,1) if st.getQuestItemsCount(SUSPICIOUS_DOCUMENT) == 5 : st.takeItems(SUSPICIOUS_DOCUMENT,5) st.giveItems(RECIPE_OF_SUPPLY,1) st.playSound("ItemSound.quest_itemget") st.playSound("ItemSound.quest_itemget") return QUEST = Quest(360,"360_PlunderTheirSupplies","Plunder Their Supplies") CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(COLEMAN) CREATED.addTalkId(COLEMAN) STARTED.addTalkId(COLEMAN) STARTED.addKillId(TAIK_SEEKER) STARTED.addKillId(TAIK_LEADER) STARTED.addQuestDrop(COLEMAN,RECIPE_OF_SUPPLY,1) STARTED.addQuestDrop(COLEMAN,SUPPLY_ITEM,1) STARTED.addQuestDrop(COLEMAN,SUSPICIOUS_DOCUMENT,1) print "importing quests: 360: Plunder Their Supplies"
KABOO_CHIEF_TORC2_ID) == 0: st.giveItems(KABOO_CHIEF_TORC2_ID, 1) st.playSound("ItemSound.quest_middle") elif npcId == 27068: st.set("id", "0") if int(st.get("cond")) == 1: if st.getQuestItemsCount( KENDNELLS_ORDER8_ID) and st.getQuestItemsCount( KABOO_CHIEF_TORC2_ID) == 0: st.giveItems(KABOO_CHIEF_TORC2_ID, 1) st.playSound("ItemSound.quest_middle") return QUEST = Quest(105, qn, "Skirmish With Orcs") CREATED = State('Start', QUEST) STARTING = State('Starting', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(30218) QUEST.addTalkId(30218) QUEST.addKillId(27059) QUEST.addKillId(27060) QUEST.addKillId(27061) QUEST.addKillId(27062) QUEST.addKillId(27064) QUEST.addKillId(27065)