Example #1
0
 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
Example #2
0
def checkCondition(player):
    party = player.getParty()
    if party:
        player.sendPacket(
            SystemMessage.sendString("Pailaka only for one person."))
        return False
    return True
Example #3
0
 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
Example #4
0
 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
Example #5
0
	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
Example #6
0
 def sendString(self,player,string):
     player.sendPacket(SystemMessage.sendString(string))
Example #7
0
def checkCondition(player):
    party = player.getParty()
    if party:
        player.sendPacket(SystemMessage.sendString("Pailaka only for one person."))    
        return False
    return True
Example #8
0
 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
Example #9
0
 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
Example #10
0
 def sendString(self, player, string):
     player.sendPacket(SystemMessage.sendString(string))