Beispiel #1
0
 def onTalk(self, npc, player):
     if not checkPrimaryConditions(player):
         return
     tele = PyObject()
     dataIndex = getKamaIndex(KamalokaLevel)
     tele.x = KamaPorts[dataIndex][0]
     tele.y = KamaPorts[dataIndex][1]
     tele.z = KamaPorts[dataIndex][2]
     instanceId = getExistingInstanceId(player)
     if instanceId == 0:
         # brand new instance
         if not checkNewInstanceConditions(player):
             return
         instanceId = InstanceManager.getInstance().createDynamicInstance(KamaTemplate[dataIndex])
         if not self.worlds.has_key(instanceId):
             world = PyObject()
             world.rewarded = []
             world.instanceId = instanceId
             self.worlds[instanceId] = world
             self.world_ids.append(instanceId)
             self.currentWorld = instanceId
             instanceObj = InstanceManager.getInstance().getInstance(instanceId)
             instanceObj.setAllowSummon(False)
             instanceObj.setReturnTeleport(
                 ReturnPort[dataIndex][0], ReturnPort[dataIndex][1], ReturnPort[dataIndex][2]
             )
             print "近緣欲界-深淵之廳:使用 " + InstanceTemplate + " 即時地區:" + str(instanceId) + " 創造玩家:" + str(player.getName())
             runStartRoom(self, world)
             tele.instanceId = instanceId
             player.setKamaDate(1)
             player.removeActiveBuffForKama()
             teleportPlayer(self, player, tele)
             party = player.getParty()
             if party != None:
                 for partyMember in party.getPartyMembers().toArray():
                     partyMember.setKamaDate(1)
                     partyMember.removeActiveBuffForKama()
                     teleportPlayer(self, partyMember, tele)
     else:
         # party already in Kamaloka
         foundworld = False
         for worldid in self.world_ids:
             if worldid == instanceId:
                 foundworld = True
         if not foundworld:
             player.sendPacket(SystemMessage.sendString("你的隊員已進入其它的即時地區。"))
             return
         instanceObj = InstanceManager.getInstance().getInstance(instanceId)
         if instanceObj.getCountPlayers() >= KamaPartySize[dataIndex]:
             player.sendPacket(SystemMessage(SystemMessageId.PARTY_EXCEEDED_THE_LIMIT_CANT_ENTER))
             return
         tele.instanceId = instanceId
         player.removeActiveBuffForKama()
         teleportPlayer(self, player, tele)
     return
Beispiel #2
0
def enterInstance(self, player, template, teleto) :
	instanceId = 0
	party = player.getParty()
	#check for existing instances of party members
	if party :
		for partyMember in party.getPartyMembers().toArray() :
			st = partyMember.getQuestState(qn)
			if not st : st = self.newQuestState(partyMember)
			if partyMember.getInstanceId()!= 0 :
				instanceId = partyMember.getInstanceId()
				if debug: print "HBTown : found party member in instance:"+str(instanceId)
	else :
		if player.getInstanceId()!=0 :
			instanceId = player.getInstanceId()
	#existing instance
	if instanceId != 0 :
		if not checkConditions(player, False) :
			return 0
		foundworld = False
		for worldid in self.world_ids :
			if worldid == instanceId :
				foundworld = True
		if not foundworld:
			player.sendPacket(SystemMessage(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER))
			return 0
		teleto.instanceId = instanceId
		teleportPlayer(self, player, teleto)
		return instanceId
	#new instance
	else:
		if not checkConditions(player, True) :
			return 0
		instanceId = InstanceManager.getInstance().createDynamicInstance(template)
		if not instanceId in self.world_ids :
			world = PyObject()
			world.rewarded = []
			world.instanceId = instanceId
			self.worlds[instanceId] = world
			self.world_ids.append(instanceId)
			self.currentWorld = instanceId
			instanceObj = InstanceManager.getInstance().getInstance(instanceId)
			print "地獄舊市區:使用 " + template + " 即時地區:" +str(instanceId) + " 創造玩家:" + str(player.getName())
			runStartRoom(self, world)
		# teleports player
		teleto.instanceId = instanceId
		for partyMember in party.getPartyMembers().toArray() :
			teleportPlayer(self, partyMember, 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("你的隊員已進入其它的即時地區。"))
            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)
            if debug: 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
        for partyMember in party.getPartyMembers().toArray() :
            st = partyMember.getQuestState(qn)
            if not st : st = self.newQuestState(partyMember)
	    st.takeItems(9694,-1)
	    st.takeItems(9698,-1)
	    st.takeItems(9699,-1)
            teleto.instanceId = instanceId
            teleportplayer(self,partyMember,teleto,True)
        return instanceId
    return instanceId
Beispiel #4
0
	def onTalk (self, npc, player) :
		npcId = npc.getNpcId()
		st = player.getQuestState(qn)
		if not st :
			st = self.newQuestState(player)
		if npcId == 32346 :
			party = player.getParty()
			if not party:
				htmltext = "<html><body>卡納夫:<br>獨自進入市區,簡直就是自殺行為。與夥伴們一起吧。</body></html>" 
				return htmltext
			else :
				tele = PyObject()
				tele.x = 14205
				tele.y = 255451
				tele.z = -2025
				enterInstance(self, player, "HBTown.xml", tele)
		if npc.getInstanceId() in self.worlds:
			world = self.worlds[npc.getInstanceId()]
			if npcId == 32343 :
				if not st.getQuestItemsCount(KEYEVILEYE) >= 1 :
					htmltext = "<html><body>月光石碑:<br>任務道具不符。</body></html>" 
					return htmltext
				else :
					st.takeItems(KEYEVILEYE,1)
					tele = PyObject()
					tele.x = 13093
					tele.y = 282097
					tele.z = -9699
					instanceObj = InstanceManager.getInstance().getInstance(self.currentWorld)
					instanceObj.setReturnTeleport(ReturnPort[dataIndex][0],ReturnPort[dataIndex][1],ReturnPort[dataIndex][2])
					instanceObj.setDuration(300000)
					return
		return ""
Beispiel #5
0
 def onKill(self, npc, player, isPet):
     npcId = npc.getNpcId()
     if self.worlds.has_key(npc.getInstanceId()):
         world = self.worlds[npc.getInstanceId()]
         if world.status == 0:
             if npcId == 22503:
                 newNpc = self.addSpawn(
                     KamaBoss1[0], 15829, -174885, -10395, 0, False, 0, False, world.instanceId
                 )  # Boss
                 world.startRoom.npclist[newNpc] = False
             if npcId == 25622:
                 newNpc = self.addSpawn(
                     KamaBoss[0], 12050, -174887, -9951, 0, False, 0, False, world.instanceId
                 )  # Boss
                 world.startRoom.npclist[newNpc] = False
             if npcId == 29147:
                 instanceObj = InstanceManager.getInstance().getInstance(self.currentWorld)
                 instanceObj.setDuration(300000)
                 instanceObj.removeNpcs()
                 party = player.getParty()
                 if party != None:
                     for partyMember in party.getPartyMembers().toArray():
                         partyMember.sendPacket(
                             SystemMessage.sendString("從現在起將會限制進入即時地區:「欲界 (深淵迷宮)」。下一次的進場時間可透過「/即時地區」指令來查詢。")
                         )
     return
Beispiel #6
0
 def onKill(self, npc, player, isPet):
     npcId = npc.getNpcId()
     if self.worlds.has_key(npc.getInstanceId()):
         world = self.worlds[npc.getInstanceId()]
         if world.status == 0:
             if npcId == 22491:
                 newNpc = self.addSpawn(KamaBoss1[0], -82442, -174918,
                                        -10491, 0, False, 0, False,
                                        world.instanceId)  # Boss
                 world.startRoom.npclist[newNpc] = False
             if npcId == 25618:
                 newNpc = self.addSpawn(KamaBoss[0], -86233, -174918,
                                        -10047, 0, False, 0, False,
                                        world.instanceId)  # Boss
                 world.startRoom.npclist[newNpc] = False
             if npcId == 29135:
                 instanceObj = InstanceManager.getInstance().getInstance(
                     self.currentWorld)
                 instanceObj.setDuration(300000)
                 instanceObj.removeNpcs()
                 party = player.getParty()
                 if party != None:
                     for partyMember in party.getPartyMembers().toArray():
                         partyMember.sendPacket(
                             SystemMessage.sendString(
                                 "從現在起將會限制進入即時地區:「欲界 (深淵迷宮)」。下一次的進場時間可透過「/即時地區」指令來查詢。"
                             ))
     return
Beispiel #7
0
def enterInstance(self, player, template, tele):
    if not checkPrimaryConditions(player):
        return
    tele = PyObject()
    dataIndex = getDcmIndex(DcmLevel)
    tele.x = DcmPorts[dataIndex][0]
    tele.y = DcmPorts[dataIndex][1]
    tele.z = DcmPorts[dataIndex][2]
    instanceId = getExistingInstanceId(player)
    if instanceId == 0:
        #brand new instance
        if not checkNewInstanceConditions(player):
            return
        instanceId = InstanceManager.getInstance().createDynamicInstance(
            DcmTemplate[dataIndex])
        if not self.worlds.has_key(instanceId):
            world = PyObject()
            world.rewarded = []
            world.instanceId = instanceId
            self.worlds[instanceId] = world
            self.world_ids.append(instanceId)
            self.currentWorld = instanceId
            instanceObj = InstanceManager.getInstance().getInstance(instanceId)
            instanceObj.setAllowSummon(False)
            instanceObj.setReturnTeleport(ReturnPort[dataIndex][0],
                                          ReturnPort[dataIndex][1],
                                          ReturnPort[dataIndex][2])
            print "暗雲宅邸:使用 " + InstanceTemplate + " 即時地區:" + str(
                instanceId) + " 創造玩家:" + str(player.getName())
            runStartRoom(self, world)
            tele.instanceId = instanceId
            teleportPlayer(self, player, tele)
            party = player.getParty()
            if party != None:
                for partyMember in party.getPartyMembers().toArray():
                    teleportPlayer(self, partyMember, tele)
    else:
        foundworld = False
        for worldid in self.world_ids:
            if worldid == instanceId:
                foundworld = True
        if not foundworld:
            player.sendPacket(SystemMessage.sendString("你的隊員已進入其它的即時地區。"))
            return
        tele.instanceId = instanceId
        teleportPlayer(self, player, tele)
    return
Beispiel #8
0
 def onAdvEvent(self, event, npc, player):
     htmltext = event
     st = player.getQuestState(qn)
     if not st: return
     npcId = npc.getNpcId()
     if npcId == ADLER and event == "accept":
         tele = PyObject()
         tele.x = -52855
         tele.y = 188199
         tele.z = -4700
         instanceId = enterInstance(self, player, "SongOfIceAndFire.xml",
                                    tele)
         if instanceId == 0:
             return
         st.set("cond", "1")
         st.setState(State.STARTED)
         st.playSound("ItemSound.quest_accept")
         htmltext = "32497-05.htm"
     if event == "32497-02.htm":
         if player.getLevel() < 36:
             htmltext = "32497-04.htm"
         elif player.getLevel() >= 42:
             htmltext = "32497-00.htm"
     elif event == "32500-05.htm":
         st.set("cond", "2")
         st.playSound("ItemSound.quest_itemget")
         st.giveItems(SWORD, 1)
         st.giveItems(BOOK1, 1)
     elif event == "32507-03.htm":
         st.set("cond", "4")
         st.playSound("ItemSound.quest_middle")
         st.takeItems(SWORD, -1)
         st.giveItems(ENHENCED_SWORD, 1)
         st.takeItems(WATER_ENHENCER, -1)
         st.takeItems(BOOK2, -1)
         st.giveItems(BOOK3, 1)
         st.takeItems(WATER_ENHENCER, -1)
     elif event == "32507-07.htm":
         st.set("cond", "7")
         st.playSound("ItemSound.quest_itemget")
         st.takeItems(ENHENCED_SWORD, -1)
         st.giveItems(ENHENCED_SWORD_2, 1)
         st.takeItems(FIRE_ENHENCER, -1)
         st.takeItems(BOOK5, -1)
         st.giveItems(BOOK6, 1)
     elif event == "32510-01.htm":
         st.playSound("ItemSound.quest_finish")
         st.giveItems(PSOE, 1)
         st.giveItems(PAILAKA_RING, 1)
         st.giveItems(PAILAKA_EARRING, 1)
         player.setVitalityPoints(20000, True)
         st.addExpAndSp(810000, 50000)
         st.unset("cond")
         st.exitQuest(False)
         instanceId = player.getInstanceId()
         instance = InstanceManager.getInstance().getInstance(instanceId)
         instance.setDuration(300000)
     return htmltext
Beispiel #9
0
 def onTalk(self, npc, player):
     htmltext = ""
     if not checkPrimaryConditions(player):
         htmltext = "32496-1.htm"
     else:
         instanceId = player.getInstanceId()
         instance = InstanceManager.getInstance().getInstance(instanceId)
         instance.removePlayers()
     return htmltext
Beispiel #10
0
 def onTalk(self, npc, player):
     htmltext = ""
     if not checkPrimaryConditions(player):
         htmltext = "<html><body>月光石碑:<br>你不是隊長!</body></html>"
     else:
         instanceId = player.getInstanceId()
         instance = InstanceManager.getInstance().getInstance(instanceId)
         instance.removePlayers()
     return htmltext
Beispiel #11
0
 def onTalk (self,npc,player):
   htmltext = ""
   if not checkPrimaryConditions(player):
     htmltext = "<html><body>月光石碑:<br>你不是隊長!</body></html>"
   else:
       instanceId = player.getInstanceId()
       instance = InstanceManager.getInstance().getInstance(instanceId)
       instance.removePlayers()
   return htmltext
Beispiel #12
0
 def onTalk (self,npc,player):
   htmltext = ""
   if not checkPrimaryConditions(player):
     htmltext = "32496-1.htm"
   else:
       instanceId = player.getInstanceId()
       instance = InstanceManager.getInstance().getInstance(instanceId)
       instance.removePlayers()
   return htmltext
Beispiel #13
0
 def onAdvEvent(self,event,npc,player):
     htmltext = event
     st = player.getQuestState(qn)
     if not st: return
     npcId = npc.getNpcId()
     if npcId == ADLER and event == "accept":
         tele = PyObject()
         tele.x = -52855
         tele.y = 188199
         tele.z = -4700
         instanceId = enterInstance(self, player, "SongOfIceAndFire.xml", tele)
         if instanceId == 0:
             return
         st.set("cond","1")
         st.setState(State.STARTED)
         st.playSound("ItemSound.quest_accept")
         htmltext = "32497-05.htm"
     if event == "32497-02.htm":
         if player.getLevel() < 36:
             htmltext = "32497-04.htm"
         elif player.getLevel() >= 42:
             htmltext = "32497-00.htm"
     elif event == "32500-05.htm":
         st.set("cond","2")
         st.playSound("ItemSound.quest_itemget")
         st.giveItems(SWORD, 1)
         st.giveItems(BOOK1, 1)
     elif event == "32507-03.htm":
         st.set("cond","4")
         st.playSound("ItemSound.quest_middle")
         st.takeItems(SWORD, -1)
         st.giveItems(ENHENCED_SWORD, 1)
         st.takeItems(WATER_ENHENCER, -1)
         st.takeItems(BOOK2, -1)
         st.giveItems(BOOK3,1)
         st.takeItems(WATER_ENHENCER, -1)
     elif event == "32507-07.htm":
         st.set("cond","7")
         st.playSound("ItemSound.quest_itemget")
         st.takeItems(ENHENCED_SWORD, -1)
         st.giveItems(ENHENCED_SWORD_2, 1)
         st.takeItems(FIRE_ENHENCER, -1)
         st.takeItems(BOOK5, -1)
         st.giveItems(BOOK6, 1)
     elif event == "32510-01.htm":
         st.playSound("ItemSound.quest_finish")
         st.giveItems(PSOE, 1)
         st.giveItems(PAILAKA_RING, 1)
         st.giveItems(PAILAKA_EARRING, 1)
         player.setVitalityPoints(20000, True)
         st.addExpAndSp(810000, 50000)
         st.unset("cond")
         st.exitQuest(False)
         instanceId = player.getInstanceId()
         instance = InstanceManager.getInstance().getInstance(instanceId)
         instance.setDuration(300000)
     return htmltext
Beispiel #14
0
	def onKill(self,npc,player,isPet):
		npcId = npc.getNpcId()
		if self.worlds.has_key(npc.getInstanceId()):
			world = self.worlds[npc.getInstanceId()]
			if world.status == 0 :
				if npcId == KamaMob[0] :
					instanceObj = InstanceManager.getInstance().getInstance(self.currentWorld)
					instanceObj.setDuration(300000)
					instanceObj.removeNpcs()
					return
Beispiel #15
0
def enterInstance(self,player,template,teleto):
    instanceId = 0
    if not checkCondition(player):
        return 0
    # Create instance
    instanceId = InstanceManager.getInstance().createDynamicInstance(template)
    if not self.worlds.has_key(instanceId):
        world = PyObject()
        world.instanceId = instanceId
        self.worlds[instanceId]=world
        self.world_ids.append(instanceId)
        instance = InstanceManager.getInstance().getInstance(instanceId)
        instance.setAllowSummon(False)
        print "菲拉卡-冰與火之歌 (等級 36-42):" +str(instanceId) + " 創造玩家:" + str(player.getName())
        runStartRoom(self,world)
    # Teleports player
    teleto.instanceId = instanceId
    teleportplayer(self,player,teleto)
    return instanceId
Beispiel #16
0
def enterInstance(self, player, template, tele) :
  if not checkPrimaryConditions(player) :
     return
  tele = PyObject()
  dataIndex = getDcmIndex(DcmLevel)
  tele.x = DcmPorts[dataIndex][0]
  tele.y = DcmPorts[dataIndex][1]
  tele.z = DcmPorts[dataIndex][2]
  instanceId = getExistingInstanceId(player)
  if instanceId == 0 :
     #brand new instance
     if not checkNewInstanceConditions(player) :
        return
     instanceId = InstanceManager.getInstance().createDynamicInstance(DcmTemplate[dataIndex])
     if not self.worlds.has_key(instanceId) :
        world = PyObject()
        world.rewarded = []
        world.instanceId = instanceId
        self.worlds[instanceId] = world
        self.world_ids.append(instanceId)
        self.currentWorld = instanceId
        instanceObj = InstanceManager.getInstance().getInstance(instanceId)
        instanceObj.setAllowSummon(False)
        instanceObj.setReturnTeleport(ReturnPort[dataIndex][0],ReturnPort[dataIndex][1],ReturnPort[dataIndex][2])
        print "暗雲宅邸:使用 " + InstanceTemplate + " 即時地區:" + str(instanceId) + " 創造玩家:" + str(player.getName()) 
        runStartRoom(self, world)
        tele.instanceId = instanceId
        teleportPlayer(self, player, tele)
        party = player.getParty()
        if party != None :
           for partyMember in party.getPartyMembers().toArray() :
               teleportPlayer(self, partyMember, tele)
  else:
     foundworld = False
     for worldid in self.world_ids :
         if worldid == instanceId :
            foundworld = True
     if not foundworld:
        player.sendPacket(SystemMessage.sendString("你的隊員已進入其它的即時地區。"))
        return
     tele.instanceId = instanceId
     teleportPlayer(self, player, tele)
  return
Beispiel #17
0
	def onKill(self,npc,player,isPet):
		npcId = npc.getNpcId()
		if self.worlds.has_key(npc.getInstanceId()):
			world = self.worlds[npc.getInstanceId()]
			if world.status == 0 :
				if npcId == KamaMob[0] :
					instanceObj = InstanceManager.getInstance().getInstance(self.currentWorld)
					instanceObj.setDuration(300000)
					instanceObj.removeNpcs()
					return
Beispiel #18
0
def enterInstance(self, player, template, teleto):
    instanceId = 0
    if not checkCondition(player):
        return 0
    # Create instance
    instanceId = InstanceManager.getInstance().createDynamicInstance(template)
    if not self.worlds.has_key(instanceId):
        world = PyObject()
        world.instanceId = instanceId
        self.worlds[instanceId] = world
        self.world_ids.append(instanceId)
        instance = InstanceManager.getInstance().getInstance(instanceId)
        instance.setAllowSummon(False)
        print "菲拉卡-冰與火之歌 (等級 36-42):" + str(instanceId) + " 創造玩家:" + str(
            player.getName())
        runStartRoom(self, world)
    # Teleports player
    teleto.instanceId = instanceId
    teleportplayer(self, player, teleto)
    return instanceId
Beispiel #19
0
	def onAdvEvent (self,event,npc,player):
		if event == "timer" or event =="timer2":
			if self.npcobject[npc.getObjectId()].correct == False:
				dx = npc.getX() - 142999
				dy = npc.getY() - 151671
				d = dx * dx + dy * dy
				if d < 10000:
					npc.broadcastPacket(MagicSkillUse(npc, npc, 5441, 1, 1, 0))
					self.npcobject[npc.getObjectId()].correct = True
					self.worlds[npc.getInstanceId()].correct = self.worlds[npc.getInstanceId()].correct +1

			if self.npcobject[npc.getObjectId()].correct == False:
				dx = npc.getX() - 139494
				dy = npc.getY() - 151668
				d = dx * dx + dy * dy
				if d < 10000:
					npc.broadcastPacket(MagicSkillUse(npc, npc, 5441, 1, 1, 0))
					self.npcobject[npc.getObjectId()].correct = True
					self.worlds[npc.getInstanceId()].correct = self.worlds[npc.getInstanceId()].correct +1

			if self.worlds[npc.getInstanceId()].correct>=2:
				for door in InstanceManager.getInstance().getInstance(npc.getInstanceId()).getDoors():
					if door.getDoorId() == 24220026:
						door.openMe()
				return

			if self.npcobject[npc.getObjectId()].lastitem:
				L2World.getInstance().removeVisibleObject(self.npcobject[npc.getObjectId()].lastitem, self.npcobject[npc.getObjectId()].lastitem.getWorldRegion())
				L2World.getInstance().removeObject(self.npcobject[npc.getObjectId()].lastitem)
				if len(self.npcobject[npc.getObjectId()].walklist_order)==0:
					return

			for item in self.npcobject[npc.getObjectId()].walklist_order:
				crystal = self.npcobject[npc.getObjectId()].walklist[item]
				newpos = L2CharPosition(crystal.getX(), crystal.getY(), crystal.getZ(), 0)
				npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, newpos)
				self.npcobject[npc.getObjectId()].lastitem = crystal
				self.npcobject[npc.getObjectId()].walklist_order.remove(item)
				npc.broadcastPacket(NpcSay(npc.getObjectId(),0,npc.getNpcId(),"小氣鬼,只分一個給我!真是絕情耶~ ..."))
				break;

			if(len(self.npcobject[npc.getObjectId()].walklist_order))>0:
				if event == "timer":
					self.startQuestTimer("timer2",2000,npc,None)
				else:
					self.startQuestTimer("timer",2000,npc,None)
			else:
				if self.npcobject[npc.getObjectId()].last == False:
					self.npcobject[npc.getObjectId()].last = True
					if event == "timer":
						self.startQuestTimer("timer2",2000,npc,None)
					else:
						self.startQuestTimer("timer",2000,npc,None)
			return
Beispiel #20
0
def endInstance(self, world) :
  world.status = 10
  newNpc = self.addSpawn(SOTruth, 148911, 181940, -6117, 16383, False, 0, False, world.instanceId)
  instanceObj = InstanceManager.getInstance().getInstance(self.currentWorld)
  instanceObj.setDuration(300000)
  world.startRoom = None
  world.Hall = None
  world.SecondRoom = None
  world.ThirdRoom = None
  world.ThirdRoomBis = None
  world.ForthRoom = None
  world.FifthRoom = None
  if debug : print "DarkCloudMansion: finished"
Beispiel #21
0
def endInstance(self, world):
    world.status = 10
    newNpc = self.addSpawn(SOTruth, 148911, 181940, -6117, 16383, False, 0,
                           False, world.instanceId)
    instanceObj = InstanceManager.getInstance().getInstance(self.currentWorld)
    instanceObj.setDuration(300000)
    world.startRoom = None
    world.Hall = None
    world.SecondRoom = None
    world.ThirdRoom = None
    world.ThirdRoomBis = None
    world.ForthRoom = None
    world.FifthRoom = None
    if debug: print "DarkCloudMansion: finished"
	def onTalk (self,npc,player):
		npcId = npc.getNpcId()
		instanceId = 0
		if npcId == ORACLE_GUIDE:
			tele = PyObject()
			tele.x = 140486
			tele.y = 148895
			tele.z = -11817
			instanceId = enterInstance(self, player, "CoralGarden.xml", tele)
		if instanceId == 0:
			return
		try:
			for door in InstanceManager.getInstance().getInstance(instanceId).getDoors():
				if door.getDoorId() == CORALGARDENGATEWAY:
					door.openMe()
		except:
			pass
		return
Beispiel #23
0
 def onTalk(self, npc, player):
     npcId = npc.getNpcId()
     instanceId = 0
     if npcId == ORACLE_GUIDE:
         tele = PyObject()
         tele.x = 140486
         tele.y = 148895
         tele.z = -11817
         instanceId = enterInstance(self, player, "CoralGarden.xml", tele)
     if instanceId == 0:
         return
     try:
         for door in InstanceManager.getInstance().getInstance(
                 instanceId).getDoors():
             if door.getDoorId() == CORALGARDENGATEWAY:
                 door.openMe()
     except:
         pass
     return
Beispiel #24
0
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()
    # 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("你的隊員已進入其它的即時地區。"))
            return
        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.instanceId = instanceId
            self.worlds[instanceId] = world
            self.world_ids.append(instanceId)
            print "Tower of Infinity: started " + template + " Instance: " + str(
                instanceId) + " created by player: " + str(player.getName())
            runFloor(self, world, 0)
        # teleports player
        for partyMember in party.getPartyMembers().toArray():
            st = partyMember.getQuestState(qn)
            if not st: st = self.newQuestState(partyMember)
            teleto.instanceId = instanceId
            teleportPlayer(self, partyMember, teleto)
        return instanceId
    return instanceId
Beispiel #25
0
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()
  # 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("你的隊員已進入其它的即時地區。"))
      return
    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.instanceId = instanceId
      self.worlds[instanceId] = world
      self.world_ids.append(instanceId)
      print "Tower of Infinity: started " + template + " Instance: " +str(instanceId) + " created by player: " + str(player.getName())
      runFloor(self, world, 0)
    # teleports player
    for partyMember in party.getPartyMembers().toArray() :
      st = partyMember.getQuestState(qn)
      if not st : st = self.newQuestState(partyMember)
      teleto.instanceId = instanceId
      teleportPlayer(self, partyMember, teleto)
    return instanceId
  return instanceId
Beispiel #26
0
 def onKill(self, npc, player, isPet):
     instance = InstanceManager.getInstance().getInstance(
         npc.getInstanceId())
     npcId = npc.getNpcId()
     if npc.getNpcId() == GK1:
         partyMembers = [player]
         party = player.getParty()
         if party:
             partyMembers = party.getPartyMembers().toArray()
             for player in partyMembers:
                 pst = player.getQuestState("EmeraldSteam")
                 if pst:
                     pst.giveItems(9698, 1)
         else:
             pst = player.getQuestState("EmeraldSteam")
             if pst:
                 pst.giveItems(9698, 1)
     if npc.getNpcId() == GK2:
         partyMembers = [player]
         party = player.getParty()
         if party:
             partyMembers = party.getPartyMembers().toArray()
             for player in partyMembers:
                 pst = player.getQuestState("EmeraldSteam")
                 if pst:
                     pst.giveItems(9699, 1)
         else:
             pst = player.getQuestState("EmeraldSteam")
             if pst:
                 pst.giveItems(9699, 1)
     for nnpc in instance.getNpcs():
         if nnpc:
             if nnpc.getNpcId(
             ) == GK1 and nnpc.getNpcId() != npc.getNpcId():
                 nnpc.decayMe()
             if nnpc.getNpcId(
             ) == GK2 and nnpc.getNpcId() != npc.getNpcId():
                 nnpc.decayMe()
     return
Beispiel #27
0
	def onKill (self,npc,player,isPet):
		instance = InstanceManager.getInstance().getInstance(npc.getInstanceId())
		npcId = npc.getNpcId()
		if npc.getNpcId() == GK1:
			partyMembers = [player]
			party = player.getParty()
			if party :
				partyMembers = party.getPartyMembers().toArray()
				for player in partyMembers :
					pst = player.getQuestState("EmeraldSteam")
					if pst :
						pst.giveItems(9698,1)
			else :
				pst = player.getQuestState("EmeraldSteam")
				if pst :
					pst.giveItems(9698,1)
		if npc.getNpcId() == GK2:
			partyMembers = [player]
			party = player.getParty()
			if party :
				partyMembers = party.getPartyMembers().toArray()
				for player in partyMembers :
					pst = player.getQuestState("EmeraldSteam")
					if pst :
						pst.giveItems(9699,1)
			else :
				pst = player.getQuestState("EmeraldSteam")
				if pst :
					pst.giveItems(9699,1)
		for nnpc in instance.getNpcs():
			if nnpc:
				if nnpc.getNpcId() == GK1 and nnpc.getNpcId() != npc.getNpcId():
					nnpc.decayMe()
				if nnpc.getNpcId() == GK2 and nnpc.getNpcId() != npc.getNpcId():
					nnpc.decayMe()
		return
Beispiel #28
0
def closeDoor(doorId, instanceId):
    for door in InstanceManager.getInstance().getInstance(
            instanceId).getDoors():
        if door.getDoorId() == doorId:
            door.closeMe()
Beispiel #29
0
def openDoor(doorId, instanceId):
    for door in InstanceManager.getInstance().getInstance(
            instanceId).getDoors():
        if door.getDoorId() == doorId:
            door.openMe()
Beispiel #30
0
def closeDoor(doorId,instanceId) :
  for door in InstanceManager.getInstance().getInstance(instanceId).getDoors() :
    if door.getDoorId() == doorId :
      door.closeMe()
def openDoor(doorId,instanceId):
	for door in InstanceManager.getInstance().getInstance(instanceId).getDoors():
		if door.getDoorId() == doorId:
			door.openMe()