def onTalk(self, npc, player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st: return htmltext npcId = npc.getNpcId() if npcId == YOGI: account = player.getAccountName() if account in FORBIDDEN_ACCOUNTS: player.sendPacket( SystemMessage.sendString( "Your account is not allowed to participate in the event. Contact a GameMaster if you need explanations." )) return "" if ALLOWEDLEVELS > 0 and player.getLevel() < ALLOWEDLEVELS: player.sendPacket( SystemMessage.sendString( "Sorry, you may only take part of this event once you reached level " + str(ALLOWEDLEVELS))) return "" htmltext = st.showHtmlFile("32599.htm").replace( "Adena1", str(1000 * RATE)) htmltext = htmltext.replace("Adena2", str(6000 * RATE)) htmltext = htmltext.replace("Adena3", str(77777 * RATE)) htmltext = htmltext.replace("Adena4", str(777770 * RATE)) return htmltext
def onAdvEvent (self,event,npc,player): htmltext = event st = player.getQuestState(qn) if not st: return if event == "tradeall": item = player.getInventory().getItemByItemId(BADGE) if not item: player.sendPacket(SystemMessage.sendString("You don't have any Darion Badges in your Inventory.")) return if item.getCount() >= 10: for step in range(10,item.getCount(),10): player.destroyItemByItemId("Hude", BADGE, 10, player, True) i = Rnd.get(len(HUDE_ITEMS)) player.addItem("Hude", HUDE_ITEMS[i], 1, player, True, True) return if event == "trade": item = player.getInventory().getItemByItemId(BADGE) if not item: player.sendPacket(SystemMessage.sendString("You must have 10 Darion Badges in your Inventory.")) return elif item.getCount() < 10: player.sendPacket(SystemMessage.sendString("You must have 10 Darion Badges in your Inventory.")) return else: player.destroyItemByItemId("Hude", BADGE, 10, player, True) i = Rnd.get(len(HUDE_ITEMS)) player.addItem("Hude", HUDE_ITEMS[i], 1, player, True, True) return return htmltext
def checkCondition(player): if not player.getLevel() >= 78: player.sendPacket(SystemMessage.sendString("You must be level 78 to enter Dark Cloud Mansion.")) return False party = player.getParty() if not party: player.sendPacket(SystemMessage.sendString("You must be in a party with at least one other person.")) return False if party and party.getMemberCount() > 2: player.sendPacket(SystemMessage.sendString("Dark Cloud Mansion for max 2 players in party.")) return False return True
def checkCondition(player): if not player.getLevel() >= 78: player.sendPacket(SystemMessage.sendString("You must be level 78 to enter Dark Cloud Mansion.")) return False party = player.getParty() if not party: player.sendPacket(SystemMessage.sendString("You are not currently in a party, so you cannot enter.")) return False if party and party.getMemberCount() > 2: player.sendPacket(SystemMessage.sendString("You cannot enter due to the party having exceeded the limit.")) return False return True
def checkCondition(player): if not player.getLevel() >= 78: player.sendPacket(SystemMessage.sendString("You must be level 78 to enter Crystal Caverns.")) return False party = player.getParty() if not party: player.sendPacket(SystemMessage.sendString("You must be in a party with at least one other person.")) return False item = player.getInventory().getItemByItemId(CRYSTAL) if not item: player.sendPacket(SystemMessage.sendString("You must have a Contaminated Crystal in your Inventory.")) return False return True
def onAdvEvent(self, event, npc, player): st = player.getQuestState(qn) if not st: st = self.newQuestState(player) level = int(event[3:]) KamaInfo = KAMALOKA[level] if not KamaInfo[9]: player.sendPacket( SystemMessage.sendString( "This Kamaloka has been disabled by an Admin")) return party = player.getParty() if party: partyLeader = st.getPlayer().getParty().getLeader() if player != partyLeader: player.sendPacket( SystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER)) return if player.getInstanceId() != 0: player.sendPacket( SystemMessage(SystemMessageId. ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER)) return instanceId = enterInstance(self, player, KamaInfo, level) if not instanceId: return if instanceId == 0: return return
def onTalk (self,npc,player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st : return htmltext npcId = npc.getNpcId() if npcId == YOGI : account = player.getAccountName() if account in FORBIDDEN_ACCOUNTS: player.sendPacket(SystemMessage.sendString("Your account is not allowed to participate in the event. Contact a GameMaster if you need explanations.")) return "" if ALLOWEDLEVELS > 0 and player.getLevel() < ALLOWEDLEVELS: player.sendPacket(SystemMessage.sendString("Sorry, you may only take part of this event once you reached level "+str(ALLOWEDLEVELS))) return "" htmltext = st.showHtmlFile("32599.htm").replace("Adena1", str(1000 * RATE)) htmltext = htmltext.replace("Adena2", str(6000 * RATE)) htmltext = htmltext.replace("Adena3", str(77777 * RATE)) htmltext = htmltext.replace("Adena4", str(777770 * RATE)) return htmltext
def checkCondition(player): if not player.getLevel() >= 78: player.sendPacket( SystemMessage.sendString( "You must be level 78 to enter Dark Cloud Mansion.")) return False party = player.getParty() if not party: player.sendPacket( SystemMessage.sendString( "You are not currently in a party, so you cannot enter.")) return False if party and party.getMemberCount() > 2: player.sendPacket( SystemMessage.sendString( "You cannot enter due to the party having exceeded the limit.") ) return False return True
def checkCondition(player): if not player.getLevel() >= 78: player.sendPacket( SystemMessage.sendString( "You must be level 78 to enter Crystal Caverns.")) return False party = player.getParty() if not party: player.sendPacket( SystemMessage.sendString( "You must be in a party with at least one other person.")) return False item = player.getInventory().getItemByItemId(CRYSTAL) if not item: player.sendPacket( SystemMessage.sendString( "You must have a Contaminated Crystal in your Inventory.")) return False return True
def enterInstance(self, player, template, teleto): instanceId = 0 if not checkCondition(player): return 0 party = player.getParty() # Check for existing instances of party members for partyMember in party.getPartyMembers().toArray(): if partyMember.getInstanceId() != 0: instanceId = partyMember.getInstanceId() if debug: print "Emerald/Steam: found party member in instance:" + str( instanceId) # Existing instance if instanceId != 0: foundworld = False for worldid in self.world_ids: if worldid == instanceId: foundworld = True if not foundworld: player.sendPacket( SystemMessage.sendString( "Your Party Members are in another Instance.")) return 0 teleto.instanceId = instanceId teleportplayer(self, player, teleto, True) return instanceId # New instance else: instanceId = InstanceManager.getInstance().createDynamicInstance( template) if not self.worlds.has_key(instanceId): world = PyObject() world.instanceId = instanceId world.bosses = 5 self.worlds[instanceId] = world self.world_ids.append(instanceId) print "Emerald/Steam Instance: " + str( instanceId) + " created by player: " + str(player.getName()) # Close all doors for door in InstanceManager.getInstance().getInstance( instanceId).getDoors(): door.closeMe() # Start the first room runEmeraldAndSteamFirstRoom(self, world) # Teleports player teleto.instanceId = instanceId teleportplayer(self, player, teleto, True) return instanceId return instanceId
def enterInstance(self, player, template, teleto): instanceId = 0 if not checkCondition(player): return 0 party = player.getParty() # Check for exising instances of party members for partyMember in party.getPartyMembers().toArray(): if partyMember.getInstanceId() != 0: instanceId = partyMember.getInstanceId() if debug: print "DarkCloudMansion: found party member in instance:" + str( instanceId) # Existing instance if instanceId != 0: foundworld = False for worldid in self.world_ids: if worldid == instanceId: foundworld = True if not foundworld: player.sendPacket( SystemMessage.sendString( "Your Party Members are in another Instance.")) return 0 teleto.instanceId = instanceId teleportplayer(self, player, teleto) return instanceId # New instance else: instanceId = InstanceManager.getInstance().createDynamicInstance( template) if not self.worlds.has_key(instanceId): world = PyObject() world.rewarded = [] world.instanceId = instanceId self.worlds[instanceId] = world self.world_ids.append(instanceId) print "DarkCloudMansion: started " + template + " Instance: " + str( instanceId) + " created by player: " + str(player.getName()) runStartRoom(self, world) # teleports player teleto.instanceId = instanceId teleportplayer(self, player, teleto) return instanceId return instanceId
def enterInstance(self,player,template,teleto): instanceId = 0 if not checkCondition(player): return 0 party = player.getParty() # Check for existing instances of party members for partyMember in party.getPartyMembers().toArray(): if partyMember.getInstanceId()!=0: instanceId = partyMember.getInstanceId() if debug: print "Emerald/Steam: found party member in instance:"+str(instanceId) # Existing instance if instanceId != 0: foundworld = False for worldid in self.world_ids: if worldid == instanceId: foundworld = True if not foundworld: player.sendPacket(SystemMessage.sendString("Your Party Members are in another Instance.")) return 0 teleto.instanceId = instanceId teleportplayer(self,player,teleto,True) return instanceId # New instance else: instanceId = InstanceManager.getInstance().createDynamicInstance(template) if not self.worlds.has_key(instanceId): world = PyObject() world.instanceId = instanceId world.bosses = 5 self.worlds[instanceId]=world self.world_ids.append(instanceId) print "Emerald/Steam Instance: " +str(instanceId) + " created by player: " + str(player.getName()) # Close all doors for door in InstanceManager.getInstance().getInstance(instanceId).getDoors(): door.closeMe() # Start the first room runEmeraldAndSteamFirstRoom(self,world) # Teleports player teleto.instanceId = instanceId teleportplayer(self,player,teleto,True) return instanceId return instanceId
def enterInstance(self,player,template,teleto): instanceId = 0 if not checkCondition(player): return 0 party = player.getParty() # Check for exising instances of party members for partyMember in party.getPartyMembers().toArray(): if partyMember.getInstanceId()!=0: instanceId = partyMember.getInstanceId() if debug: print "DarkCloudMansion: found party member in instance:"+str(instanceId) # Existing instance if instanceId != 0: foundworld = False for worldid in self.world_ids: if worldid == instanceId: foundworld = True if not foundworld: player.sendPacket(SystemMessage.sendString("Your Party Members are in another Instance.")) return 0 teleto.instanceId = instanceId teleportplayer(self,player,teleto) return instanceId # New instance else: instanceId = InstanceManager.getInstance().createDynamicInstance(template) if not self.worlds.has_key(instanceId): world = PyObject() world.rewarded=[] world.instanceId = instanceId self.worlds[instanceId]=world self.world_ids.append(instanceId) print "DarkCloudMansion: started " + template + " Instance: " +str(instanceId) + " created by player: " + str(player.getName()) runStartRoom(self,world) # teleports player teleto.instanceId = instanceId teleportplayer(self,player,teleto) return instanceId return instanceId
def onAdvEvent (self,event,npc,player): st = player.getQuestState(qn) if not st: st = self.newQuestState(player) level = int(event[3:]) KamaInfo = KAMALOKA[level] if not KamaInfo[9]: player.sendPacket(SystemMessage.sendString("This Kamaloka has been disabled by an Admin")) return party = player.getParty() if party: partyLeader = st.getPlayer().getParty().getLeader() if player != partyLeader: player.sendPacket(SystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER)) return if player.getInstanceId() != 0: player.sendPacket(SystemMessage(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER)) return instanceId = enterInstance(self,player,KamaInfo,level) if not instanceId: return if instanceId == 0: return return
def sendString(self, player, string): player.sendPacket(SystemMessage.sendString(string))
def onAdvEvent(self, event, npc, player): if event == "Autochat": text = TEXTS[Rnd.get(len(TEXTS))] npc.broadcastPacket( NpcSay(npc.getObjectId(), 0, npc.getNpcId(), str(text))) return elif event == "SpawnYogi": self.yogiSpawnList = [] yogi = self.addSpawn(YOGI, 82941, 149318, -3473, 39138, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 148022, -55481, -2738, 34214, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 15776, 142872, -2710, 17423, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, -14067, 123290, -3121, 18774, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 87015, -143229, -1296, 4092, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 117104, 77017, -2699, 32767, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 146772, 25906, -2017, 57344, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 43984, -47713, -801, 47497, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 82882, 53098, -1500, 17351, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, -83127, 150941, -3133, 0, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 111333, 219424, -3550, 48247, False, 0, False, 0) self.yogiSpawnList.append(yogi) if AUTODESPAWN: self.startQuestTimer("DespawnYogi", 1800000, None, None) return elif event == "DespawnYogi": DATE = getDate(self) if int(DATE) <= int(EVENTENDDATE): self.startQuestTimer("DespawnYogi", 1800000, None, None) else: for yogi in self.yogiSpawnList: yogi.decayMe() print "Master of Enchanting event is finished" return st = player.getQuestState(qn) if not st: st = self.newQuestState(player) htmltext = event npcId = npc.getNpcId() if npcId == YOGI: if event == "32599.htm": htmltext = st.showHtmlFile("32599.htm").replace( "Adena1", str(1000 * RATE)) htmltext = htmltext.replace("Adena2", str(6000 * RATE)) htmltext = htmltext.replace("Adena3", str(77777 * RATE)) htmltext = htmltext.replace("Adena4", str(777770 * RATE)) elif event == "32599-01.htm": if st.getQuestItemsCount(STAFF) >= 1 or st.getQuestItemsCount( ADENA) < 1000 * RATE: htmltext = "32599-02.htm" else: st.takeItems(ADENA, 1000 * RATE) st.giveItems(STAFF, 1) elif event == "32599-03.htm": if st.getQuestItemsCount(ADENA) < 6000 * RATE: htmltext = "32599-02.htm" else: lastUsed = check(self, player) if lastUsed == 0: st.takeItems(ADENA, 6000 * RATE) st.giveItems(SCROLL, 24) else: remainingTime = (lastUsed + 21600) - ( System.currentTimeMillis() / 1000) player.sendPacket( SystemMessage.sendString("Remaining time: " + str(remainingTime) + " seconds")) elif event == "32599-05.htm": if st.getQuestItemsCount(ADENA) < 77777 * RATE: htmltext = "32599-02.htm" else: st.takeItems(ADENA, 77777 * RATE) st.giveItems(SCROLL, 1) elif event == "32599-06.htm": if st.getQuestItemsCount(ADENA) < 777770 * RATE: htmltext = "32599-02.htm" else: st.takeItems(ADENA, 777770 * RATE) st.giveItems(SCROLL, 10) elif event == "Rewards": account = player.getAccountName() if account in FORBIDDEN_ACCOUNTS: player.sendPacket( SystemMessage.sendString( "Your account is not allowed to participate in the event. Contact a GameMaster if you need explanations." )) return "" weapon = player.getInventory().getPaperdollItem( Inventory.PAPERDOLL_LRHAND) if weapon: weaponId = weapon.getItemId() if weaponId == STAFF and weapon.getEnchantLevel() > 3: enchant = weapon.getEnchantLevel() if LOGVALUE > 0 and enchant >= LOGVALUE: print "Master of Enchanting event: Player " + str( player.getName()) + " brought a +" + str( enchant) + " weapon" rewardPlayer(self, st, enchant) htmltext = "32599-08.htm" else: htmltext = "32599-07.htm" else: htmltext = "32599-07.htm" return htmltext
def onAdvEvent (self,event,npc,player): if event == "Autochat": text = TEXTS[Rnd.get(len(TEXTS))] npc.broadcastPacket(NpcSay(npc.getObjectId(),0,npc.getNpcId(),str(text))) return elif event == "SpawnYogi": self.yogiSpawnList = [] yogi = self.addSpawn(YOGI, 82941, 149318, -3473, 39138, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 148022, -55481, -2738, 34214, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 15776, 142872, -2710, 17423, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, -14067, 123290, -3121, 18774, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 87015, -143229, -1296, 4092, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 117104, 77017, -2699, 32767, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 146772, 25906, -2017, 57344, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 43984, -47713, -801, 47497, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 82882, 53098, -1500, 17351, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, -83127, 150941, -3133, 0, False, 0, False, 0) self.yogiSpawnList.append(yogi) yogi = self.addSpawn(YOGI, 111333, 219424, -3550, 48247, False, 0, False, 0) self.yogiSpawnList.append(yogi) if AUTODESPAWN: self.startQuestTimer("DespawnYogi", 1800000, None, None) return elif event == "DespawnYogi": DATE = getDate(self) if int(DATE) <= int(EVENTENDDATE): self.startQuestTimer("DespawnYogi", 1800000, None, None) else: for yogi in self.yogiSpawnList: yogi.decayMe() print "Master of Enchanting event is finished" return st = player.getQuestState(qn) if not st: st = self.newQuestState(player) htmltext = event npcId = npc.getNpcId() if npcId == YOGI: if event == "32599.htm": htmltext = st.showHtmlFile("32599.htm").replace("Adena1", str(1000 * RATE)) htmltext = htmltext.replace("Adena2", str(6000 * RATE)) htmltext = htmltext.replace("Adena3", str(77777 * RATE)) htmltext = htmltext.replace("Adena4", str(777770 * RATE)) elif event == "32599-01.htm": if st.getQuestItemsCount(STAFF) >= 1 or st.getQuestItemsCount(ADENA) < 1000 * RATE: htmltext = "32599-02.htm" else: st.takeItems(ADENA, 1000 * RATE) st.giveItems(STAFF, 1) elif event == "32599-03.htm": if st.getQuestItemsCount(ADENA) < 6000 * RATE: htmltext = "32599-02.htm" else: lastUsed = check(self,player) if lastUsed == 0: st.takeItems(ADENA, 6000 * RATE) st.giveItems(SCROLL, 24) else: remainingTime = (lastUsed + 21600) - (System.currentTimeMillis() / 1000) player.sendPacket(SystemMessage.sendString("Remaining time: "+str(remainingTime)+" seconds")) elif event == "32599-05.htm": if st.getQuestItemsCount(ADENA) < 77777 * RATE: htmltext = "32599-02.htm" else: st.takeItems(ADENA, 77777 * RATE) st.giveItems(SCROLL, 1) elif event == "32599-06.htm": if st.getQuestItemsCount(ADENA) < 777770 * RATE: htmltext = "32599-02.htm" else: st.takeItems(ADENA, 777770 * RATE) st.giveItems(SCROLL, 10) elif event == "Rewards": account = player.getAccountName() if account in FORBIDDEN_ACCOUNTS: player.sendPacket(SystemMessage.sendString("Your account is not allowed to participate in the event. Contact a GameMaster if you need explanations.")) return "" weapon = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LRHAND); if weapon: weaponId = weapon.getItemId() if weaponId == STAFF and weapon.getEnchantLevel() > 3: enchant = weapon.getEnchantLevel() if LOGVALUE > 0 and enchant >= LOGVALUE: print "Master of Enchanting event: Player "+str(player.getName())+" brought a +"+str(enchant)+" weapon" rewardPlayer(self,st,enchant) htmltext = "32599-08.htm" else: htmltext = "32599-07.htm" else: htmltext = "32599-07.htm" return htmltext
def checkCondition(player): party = player.getParty() if party: player.sendPacket(SystemMessage.sendString("Pailaka only for one person.")) return False return True
def sendString(self,player,string): player.sendPacket(SystemMessage.sendString(string))