def changeNativeSpawn(booleanValue, corpseList, self):
    #worldObjects = SpawnTable.getInstance().getSpawnTable().values()
    worldObjects = SpawnTable.getInstance().getSpawnTable()
    if booleanValue == 0:
        for i in worldObjects:
            npcId = i.getNpcid()
            corpses = []
            if npcId in NPCS:
                curNpc = i.getLastSpawn()
                curNpc.deleteMe()
        for n in range(16):
            xx, yy, zz, head = CorpseLocs[n]
            newCorpse = self.addSpawn(NativeCorpse, xx, yy, zz, head, False, 0)
            corpses.append(newCorpse)
        return corpses
    if booleanValue == 1:
        for i in worldObjects:
            npcId = i.getNpcid()
            if npcId in NPCS:
                xx, yy, zz = i.getLocx(), i.getLocy(), i.getLocz()
                heading = i.getHeading()
                newNpc = self.addSpawn(npcId, xx, yy, zz, heading, False, 0)
        for n in corpseList:
            n.deleteMe()
        return
def changeNativeSpawn(booleanValue, corpseList, self):
	#worldObjects = SpawnTable.getInstance().getSpawnTable().values()
	worldObjects = SpawnTable.getInstance().getSpawnTable()
	if booleanValue == 0:
		for i in worldObjects:
			npcId = i.getNpcid()
			corpses = []
			if npcId in NPCS:
				curNpc = i.getLastSpawn()
				curNpc.deleteMe()
		for n in range(16):
			xx, yy, zz, head = CorpseLocs[n]
			newCorpse = self.addSpawn(NativeCorpse, xx, yy, zz, head, False, 0)
			corpses.append(newCorpse)
		return corpses
	if booleanValue == 1:
		for i in worldObjects:
			npcId = i.getNpcid()
			if npcId in NPCS:
				xx, yy, zz = i.getLocx(), i.getLocy(), i.getLocz()
				heading = i.getHeading()
				newNpc = self.addSpawn(npcId, xx, yy, zz, heading, False, 0)
		for n in corpseList:
			n.deleteMe()
		return
 def onKill(self, npc, player, isPet):
     id = npc.getNpcId()
     st = player.getQuestState("Leveling_System")
     if not st:
         st = self.newQuestState(player)
     if npc:
         if id == Keltas:
             HellboundManager.getInstance().increaseTrust(100)
             if HellboundManager.getInstance().getLevel() > 4: return
             if HellboundManager.getInstance().getLevel() == 3:
                 respTime = (
                     72 + Rnd.get(144)
                 ) * 100000  #between 2 and 4 hours respawn retail-like
             if HellboundManager.getInstance().getLevel() == 4:
                 respTime = (
                     288 + Rnd.get(576)
                 ) * 100000  #between 8 and 16 hours respawn retail-like
             self.startQuestTimer("keltasRespawn", respTime, None, None)
             for i in self.keltasmin:
                 i.deleteMe()
         if id in self.hellboundMobs.keys():
             if HellboundManager.getInstance().getLevel() > 1: return
             HellboundManager.getInstance().increaseTrust(
                 self.hellboundMobs[id]['points'])
         if id in self.hellboundMobs1.keys():
             HellboundManager.getInstance().increaseTrust(
                 self.hellboundMobs1[id]['points'])
         if id == WLGuard:
             if HellboundManager.getInstance().getLevel() == 7:
                 #worldObjects = SpawnTable.getInstance().getSpawnTable().values()
                 worldObjects = SpawnTable.getInstance().getSpawnTable()
                 for i in worldObjects:
                     if i.getNpcid() == WLGuard:
                         i.stopRespawn()
Exemple #4
0
	def spawnNpc(self, npcId, x, y, z, heading, instid):
		from com.l2jserver.gameserver.datatables import NpcTable
		from com.l2jserver.gameserver.model import L2Spawn
		from com.l2jserver.gameserver.datatables import SpawnTable
		npcTemplate = NpcTable.getInstance().getTemplate(npcId)
		npcSpawn = L2Spawn(npcTemplate)
		npcSpawn.setLocx(x)
		npcSpawn.setLocy(y)
		npcSpawn.setLocz(z)
		npcSpawn.setHeading(heading)
		npcSpawn.setAmount(1)
		npcSpawn.setInstanceId(instid)
		SpawnTable.getInstance().addNewSpawn(npcSpawn, False)
		npc = npcSpawn.doSpawn()
		#npc.setOnKillDelay(0)
		return npc
	def onKill(self, npc, player, isPet):
		id = npc.getNpcId()
		st = player.getQuestState("Leveling_System")
		if not st:
			st = self.newQuestState(player)
		if npc:
			if id == Keltas:
				HellboundManager.getInstance().increaseTrust(100)
				if HellboundManager.getInstance().getLevel() > 4: return
				if HellboundManager.getInstance().getLevel() == 3: respTime = (72 + Rnd.get(144)) * 100000 #between 2 and 4 hours respawn retail-like
				if HellboundManager.getInstance().getLevel() == 4: respTime = (288 + Rnd.get(576)) * 100000 #between 8 and 16 hours respawn retail-like
				self.startQuestTimer("keltasRespawn", respTime, None, None)
				for i in self.keltasmin:
					i.deleteMe()
			if id in self.hellboundMobs.keys():
				if HellboundManager.getInstance().getLevel() > 1: return
				HellboundManager.getInstance().increaseTrust(self.hellboundMobs[id]['points'])
			if id in self.hellboundMobs1.keys():
				HellboundManager.getInstance().increaseTrust(self.hellboundMobs1[id]['points'])
			if id == WLGuard:
				if HellboundManager.getInstance().getLevel() == 7:
					worldObjects = SpawnTable.getInstance().getSpawnTable().values()
					for i in worldObjects:
						if i.getNpcid() == WLGuard:
							i.stopRespawn()
Exemple #6
0
 def spawnNpc(self, npcId, x, y, z, heading, instid):
     from com.l2jserver.gameserver.datatables import NpcTable
     from com.l2jserver.gameserver.model import L2Spawn
     from com.l2jserver.gameserver.datatables import SpawnTable
     npcTemplate = NpcTable.getInstance().getTemplate(npcId)
     npcSpawn = L2Spawn(npcTemplate)
     npcSpawn.setLocx(x)
     npcSpawn.setLocy(y)
     npcSpawn.setLocz(z)
     npcSpawn.setHeading(heading)
     npcSpawn.setAmount(1)
     npcSpawn.setInstanceId(instid)
     SpawnTable.getInstance().addNewSpawn(npcSpawn, False)
     npc = npcSpawn.doSpawn()
     #npc.setOnKillDelay(0)
     return npc
Exemple #7
0
	def onBuffTime(self):
		def check(p):
			if p.isInCombat() or p.isDead(): return False
			if isinstance(p, L2PcInstance):
				if p.isInStoreMode() or p.isInCraftMode() or p.isFakeDeath() or not p.isOnline() or p.isFishing(): return False
			return True
		def process(target):
			if check(target):
				myBuffList = None
				if isinstance(target, L2PcInstance):
					st = target.getQuestState(self.qn)
				else:
					st = target.getOwner().getQuestState(self.qn)
				if st:
					myBuffList = self.getMyBuffList(st)
				if myBuffList:
					map(lambda (skill_id, skill_lv): self.giveBuff(npc, target, skill_id, skill_lv), map(lambda b: self.buffToList(b), myBuffList.split()))
				else:
					map(lambda (skill_id, skill_lv): self.giveBuff(npc, target, skill_id, skill_lv), self.default_buff_list)
				target.setCurrentHpMp(target.getMaxHp(), target.getMaxMp())
		spawnTable = SpawnTable.getInstance()
		for npc_id in self.NPCIDs:
			for spawn in spawnTable.getSpawnTable():
				if spawn.getNpcid() == npc_id:
					npc = spawn.getLastSpawn()
					map(process, filter(lambda p: Util.checkIfInShortRadius(self.radius, npc, p, True), npc.getKnownList().getKnownPlayers().values()))
					map(process, filter(lambda p: Util.checkIfInShortRadius(self.radius, npc, p, True), npc.getKnownList().getKnownSummons().values()))
Exemple #8
0
 def spawnNpc(self, npcId, x, y, z, heading, instId):
     npcTemplate = NpcTable.getInstance().getTemplate(npcId)
     inst = InstanceManager.getInstance().getInstance(instId)
     try:
         npcSpawn = L2Spawn(npcTemplate)
         npcSpawn.setLocx(x)
         npcSpawn.setLocy(y)
         npcSpawn.setLocz(z)
         #npcSpawn.setHeading(heading)
         npcSpawn.setAmount(1)
         npcSpawn.setInstanceId(instId)
         SpawnTable.getInstance().addNewSpawn(npcSpawn, False)
         npc = npcSpawn.doSpawn()
         #npc.setOnKillDelay(0)
         #npc.setRunning()
         return npc
     except:
         print "spawnNPC error"
Exemple #9
0
 def spawnNpc(self, npcId, x, y, z, heading, instId):
     npcTemplate = NpcTable.getInstance().getTemplate(npcId)
     inst = InstanceManager.getInstance().getInstance(instId)
     try:
         npcSpawn = L2Spawn(npcTemplate)
         npcSpawn.setLocx(x)
         npcSpawn.setLocy(y)
         npcSpawn.setLocz(z)
         # npcSpawn.setHeading(heading)
         npcSpawn.setAmount(1)
         npcSpawn.setInstanceId(instId)
         SpawnTable.getInstance().addNewSpawn(npcSpawn, False)
         npc = npcSpawn.doSpawn()
         # npc.setOnKillDelay(0)
         # npc.setRunning()
         return npc
     except:
         print "spawnNPC error"
Exemple #10
0
	def onAdvEvent(self, event, npc, player):
		if event.startswith("say_"):
			dummy, npcid, index = event.split("_")
			npcid, index = int(npcid), int(index)
			for spawn in SpawnTable.getInstance().getSpawnTable():
				if npcid == spawn.getNpcid():
					self.myBroadcast(spawn.getLastSpawn(), selfTalkData[npcid][index][0])
			newindex = [index + 1, 0][index + 1 >= len(selfTalkData[npcid])]
			delay = selfTalkData[npcid][index][1]
			self.startQuestTimer("say_%d_%d" % (npcid, newindex), 1000 * delay, None, None, False)
Exemple #11
0
		def my_spawn(player, mobid, dist, perm):
			mobt = NpcTable.getInstance().getTemplate(mobid)
			if not mobt: return
			spawn = L2Spawn(mobt)
			spawn.setInstanceId(0)
			if Config.SAVE_GMSPAWN_ON_CUSTOM:
				spawn.setCustom(True)
			spawn.setLocx(player.getX()-dist+Random().nextInt(dist*2))
			spawn.setLocy(player.getY()-dist+Random().nextInt(dist*2))
			spawn.setLocz(player.getZ())
			spawn.setHeading(player.getHeading())
			spawn.setAmount(1);
			spawn.setRespawnDelay(0)
			if perm:
				SpawnTable.getInstance().addNewSpawn(spawn, True)
				spawn.init()
			else:
				spawn.stopRespawn()
				spawn.doSpawn()
Exemple #12
0
 def onAdvEvent(self, event, npc, player):
     if event.startswith("say_"):
         dummy, npcid, index = event.split("_")
         npcid, index = int(npcid), int(index)
         for spawn in SpawnTable.getInstance().getSpawnTable():
             if npcid == spawn.getNpcid():
                 self.myBroadcast(spawn.getLastSpawn(),
                                  selfTalkData[npcid][index][0])
         newindex = [index + 1, 0][index + 1 >= len(selfTalkData[npcid])]
         delay = selfTalkData[npcid][index][1]
         self.startQuestTimer("say_%d_%d" % (npcid, newindex), 1000 * delay,
                              None, None, False)
def changeBoxesSpawnState(booleanValue):
	worldObjects = SpawnTable.getInstance().getSpawnTable().values()
	for i in worldObjects:
		npcId = i.getNpcid()
		if npcId == 32361:  # 商隊支援糧食
			xx, yy, zz = i.getLocx(), i.getLocy(), i.getLocz()
			if booleanValue == 0:
				i.stopRespawn()
				curNpc = i.getLastSpawn()
				curNpc.onDecay()
			if booleanValue == 1:
				respTime = i.getRespawnDelay()
				headg = i.getHeading()
				newNpc = HellboundManager.getInstance().addSpawn(npcId, xx, yy, zz, headg, respTime)
				return
Exemple #14
0
	def onAdvEvent(self, event, npc, player):
		if event == "check":
			old_blacklist = self.blacklist[:]
			self.blacklist = []
			for spawn in SpawnTable.getInstance().getSpawnTable():
				if spawn.getNpcid() in self.NPCID:
					npc = spawn.getLastSpawn()
					for player in npc.getKnownList().getKnownPlayersInRadius(self.radius):
						playeroid = player.getObjectId()
						self.blacklist.append(playeroid)
						if playeroid not in old_blacklist:
							self.giveBuffs(npc, player)
					for player in npc.getKnownList().getKnownSummons().values():
						if Util.checkIfInRange(self.radius, npc, player, True):
							playeroid = player.getObjectId()
							self.blacklist.append(playeroid)
							if playeroid not in old_blacklist:
								self.giveBuffs(npc, player)
Exemple #15
0
 def onAdvEvent(self, event, npc, player):
     if event == "check":
         old_blacklist = self.blacklist[:]
         self.blacklist = []
         for spawn in SpawnTable.getInstance().getSpawnTable():
             if spawn.getNpcid() in self.NPCID:
                 npc = spawn.getLastSpawn()
                 for player in npc.getKnownList().getKnownPlayersInRadius(
                         self.radius):
                     playeroid = player.getObjectId()
                     self.blacklist.append(playeroid)
                     if playeroid not in old_blacklist:
                         self.giveBuffs(npc, player)
                 for player in npc.getKnownList().getKnownSummons().values(
                 ):
                     if Util.checkIfInRange(self.radius, npc, player, True):
                         playeroid = player.getObjectId()
                         self.blacklist.append(playeroid)
                         if playeroid not in old_blacklist:
                             self.giveBuffs(npc, player)
	def onAdvEvent (self, event, npc, player) :
		hellboundLevel = HellboundManager.getInstance().getLevel()
		if npc:
			npcId = npc.getNpcId()
			npcObjId = npc.getObjectId()
		if "Delete" in event and npc:
			try:
				npc.setIsInvul(0)
				npc.deleteMe()
			except:
				pass
		if "followCheck" in event and npc:
			if npc.isDead(): return
			newObjId = npc.getObjectId()
			timerName = "followCheck" + str(newObjId)
			self.startQuestTimer(timerName, 1000, npc, None)
			xx, yy, zz, headg = npc.getX(), npc.getY(), npc.getZ(), npc.getHeading()
			npc.getKnownList().removeAllKnownObjects()
			npcKnownObjects = L2World.getInstance().getVisibleObjects(npc, 2000)
			if npcKnownObjects > 0:
				for i in npcKnownObjects:
					npc.getKnownList().addKnownObject(i)
			npcKnownPlayers = npc.getKnownList().getKnownPlayers().values()
			#npcKnownObjects = npc.getKnownList().getKnownCharacers()
			#npc.getTaget().sendMessage("X:"+str(xx)+" Y:"+str(yy))
			if yy in range(249000, 249880) and xx in range(-6230, -5230):
				try:
					chat = CreatureSay(npc.getObjectId(), 0, "採石場奴隸", "謝謝您的相助,這是小小的心意。")
					npc.broadcastPacket(chat)
					aa = Rnd.get(3)
					for i in range(aa):
						xx1 = xx + (35 - Rnd.get(70))
						yy1 = yy + (35 - Rnd.get(70))
						ditem = ItemTable.getInstance().createItem("Gift", QuarryDropItems[Rnd.get(len(QuarryDropItems))], 1, None, None)
						ditem.dropMe(npc, xx1, yy1, zz)
				except:
					pass
				try:
					npc.doDie(npc)
					npc.decayMe()
				except:
					pass
				HellboundManager.getInstance().increaseTrust(10)
				self.rescued += 1
				self.saveGlobalQuestVar("rescued_Slaves", str(self.rescued))
				if self.rescued >= 1000:
					HellboundManager.getInstance().changeLevel(6)
					self.rescued = 0
					self.saveGlobalQuestVar("rescued_Slaves", str(self.rescued))
				return
			minX = xx - 170
			maxX = xx + 170
			minY = yy - 170
			maxY = yy + 170
			for neighbor in npcKnownObjects:
				if not neighbor in npcKnownPlayers:
					if neighbor.getX() in range(minX, maxX):
						if neighbor.getY() in range(minY, maxY):
							try:
								if neighbor.getNpcId() in QuarryMasters:
									neighbor.setTarget(npc)
									neighbor.addDamageHate(npc, 0, 999)
									neighbor.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc)
									neighbor.setRunning()
									return
							except:
								pass
		if event == "FollowMe":
			npcSlave = player.getTarget()
			#npcSlave.setIsFollowingMaster(1)
			npcSlave.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player)
			newObjId = npcSlave.getObjectId()
			timerName = "followCheck" + str(newObjId)
			self.startQuestTimer(timerName, 1000, npcSlave, None)
		if event == "SpawnSlaves":
			worldObjects = SpawnTable.getInstance().getSpawnTable().values()
			for i in worldObjects:
				if i.getNpcid() in SlaveMasters:
					curNpc = i.getLastSpawn()
					objId = curNpc.getObjectId()
					self.Slaves[objId] = []
					self.Slaves[objId].append("noSlaves")
					if int(hellboundLevel) >= 5: return
					xx, yy, zz = i.getLocx(), i.getLocy(), i.getLocz()
					self.Slaves[objId] = []
					offsetX = xx + (50 - Rnd.get(100))
					offsetY = yy + (50 - Rnd.get(100))
					newSlave = self.addSpawn(NativeSlave[0], offsetX, offsetY, zz, 0, False, 0, 0)
					newSlave1 = self.addSpawn(NativeSlave[1], offsetX + 20, offsetY + 10, zz, 0, False, 0, 0)
					newSlave.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, curNpc)
					newSlave1.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, curNpc)
					self.Slaves[objId].append(newSlave)
					self.Slaves[objId].append(newSlave1)
Exemple #17
0
	def getNpcInstance(self, npc_id):
		spawnTable = SpawnTable.getInstance()
		for spawn in spawnTable.getSpawnTable():
			if spawn.getNpcid() == npc_id:
				return spawn.getLastSpawn()
		return None
 def onAdvEvent(self, event, npc, player):
     hellboundLevel = HellboundManager.getInstance().getLevel()
     if npc:
         npcId = npc.getNpcId()
         npcObjId = npc.getObjectId()
     if "Delete" in event and npc:
         try:
             npc.setIsInvul(0)
             npc.deleteMe()
         except:
             pass
     if "followCheck" in event and npc:
         if npc.isDead(): return
         newObjId = npc.getObjectId()
         timerName = "followCheck" + str(newObjId)
         self.startQuestTimer(timerName, 1000, npc, None)
         xx, yy, zz, headg = npc.getX(), npc.getY(), npc.getZ(
         ), npc.getHeading()
         npc.getKnownList().removeAllKnownObjects()
         npcKnownObjects = L2World.getInstance().getVisibleObjects(
             npc, 2000)
         if npcKnownObjects > 0:
             for i in npcKnownObjects:
                 npc.getKnownList().addKnownObject(i)
         npcKnownPlayers = npc.getKnownList().getKnownPlayers().values()
         #npcKnownObjects = npc.getKnownList().getKnownCharacers()
         #npc.getTaget().sendMessage("X:"+str(xx)+" Y:"+str(yy))
         if yy in range(249000, 249880) and xx in range(-6230, -5230):
             try:
                 chat = CreatureSay(npc.getObjectId(), 0, "採石場奴隸",
                                    "謝謝您的相助,這是小小的心意。")
                 npc.broadcastPacket(chat)
                 aa = Rnd.get(3)
                 for i in range(aa):
                     xx1 = xx + (35 - Rnd.get(70))
                     yy1 = yy + (35 - Rnd.get(70))
                     ditem = ItemTable.getInstance().createItem(
                         "Gift",
                         QuarryDropItems[Rnd.get(len(QuarryDropItems))], 1,
                         None, None)
                     ditem.dropMe(npc, xx1, yy1, zz)
             except:
                 pass
             try:
                 npc.doDie(npc)
                 npc.decayMe()
             except:
                 pass
             HellboundManager.getInstance().increaseTrust(10)
             self.rescued += 1
             self.saveGlobalQuestVar("rescued_Slaves", str(self.rescued))
             if self.rescued >= 1000:
                 HellboundManager.getInstance().changeLevel(6)
                 self.rescued = 0
                 self.saveGlobalQuestVar("rescued_Slaves",
                                         str(self.rescued))
             return
         minX = xx - 170
         maxX = xx + 170
         minY = yy - 170
         maxY = yy + 170
         for neighbor in npcKnownObjects:
             if not neighbor in npcKnownPlayers:
                 if neighbor.getX() in range(minX, maxX):
                     if neighbor.getY() in range(minY, maxY):
                         try:
                             if neighbor.getNpcId() in QuarryMasters:
                                 neighbor.setTarget(npc)
                                 neighbor.addDamageHate(npc, 0, 999)
                                 neighbor.getAI().setIntention(
                                     CtrlIntention.AI_INTENTION_ATTACK, npc)
                                 neighbor.setRunning()
                                 return
                         except:
                             pass
     if event == "FollowMe":
         npcSlave = player.getTarget()
         #npcSlave.setIsFollowingMaster(1)
         npcSlave.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW,
                                       player)
         newObjId = npcSlave.getObjectId()
         timerName = "followCheck" + str(newObjId)
         self.startQuestTimer(timerName, 1000, npcSlave, None)
     if event == "SpawnSlaves":
         worldObjects = SpawnTable.getInstance().getSpawnTable().values()
         for i in worldObjects:
             if i.getNpcid() in SlaveMasters:
                 curNpc = i.getLastSpawn()
                 objId = curNpc.getObjectId()
                 self.Slaves[objId] = []
                 self.Slaves[objId].append("noSlaves")
                 if int(hellboundLevel) >= 5: return
                 xx, yy, zz = i.getLocx(), i.getLocy(), i.getLocz()
                 self.Slaves[objId] = []
                 offsetX = xx + (50 - Rnd.get(100))
                 offsetY = yy + (50 - Rnd.get(100))
                 newSlave = self.addSpawn(NativeSlave[0], offsetX, offsetY,
                                          zz, 0, False, 0, 0)
                 newSlave1 = self.addSpawn(NativeSlave[1], offsetX + 20,
                                           offsetY + 10, zz, 0, False, 0, 0)
                 newSlave.getAI().setIntention(
                     CtrlIntention.AI_INTENTION_FOLLOW, curNpc)
                 newSlave1.getAI().setIntention(
                     CtrlIntention.AI_INTENTION_FOLLOW, curNpc)
                 self.Slaves[objId].append(newSlave)
                 self.Slaves[objId].append(newSlave1)
 def __init__(self, id, name, descr):
     JQuest.__init__(self, id, name, descr)
     self.hellboundTrust = 0
     self.hellboundLevel = 0
     self.hellboundMobs = {
         22320: {
             'points': 10
         },
         22321: {
             'points': 10
         },
         22324: {
             'points': 1
         },
         22325: {
             'points': 1
         },
         22327: {
             'points': 3
         },
         22328: {
             'points': 3
         },
         22329: {
             'points': 3
         },
     }
     self.hellboundMobs1 = {
         22322: {
             'points': -10
         },
         22323: {
             'points': -10
         },
         22342: {
             'points': 3
         },
         22343: {
             'points': 3
         },
         22361: {
             'points': 20
         },
         22449: {
             'points': 50
         },
         22450: {
             'points': -10
         },
         25536: {
             'points': 200
         }
     }
     self.Warpgateloc = []
     self.Warpgate1loc = []
     self.buronloc = []
     self.kiefloc = []
     self.keltasmin = []
     self.keltasloc = []
     self.Keltas = 0
     con = L2DatabaseFactory.getInstance().getConnection()
     trigger = con.prepareStatement(
         "SELECT name FROM hellbound WHERE dummy=0")
     trigger1 = trigger.executeQuery()
     ZoneName = 100
     while (trigger1.next()):
         ZoneName = trigger1.getInt("name")
     try:
         con.close()
     except:
         pass
     if ZoneName != 8000:
         con = L2DatabaseFactory.getInstance().getConnection()
         insertion = con.prepareStatement(
             "INSERT INTO hellbound (name,trustLevel,zonesLevel,unlocked,dummy) VALUES (?,?,?,?,?)"
         )
         insertion.setInt(1, 8000)
         insertion.setInt(2, 0)
         insertion.setInt(3, 0)
         insertion.setInt(4, 0)
         insertion.setInt(5, 0)
         insertion.executeUpdate()
         insertion.close()
         try:
             con.close()
         except:
             pass
     self.hellboundLevel = HellboundManager.getInstance().getLevel()
     self.hellboundTrust = HellboundManager.getInstance().getTrust()
     if self.hellboundLevel == 0:
         self.Warpgateloc = []
         self.Warpgate1loc = []
         oldWarpgate = self.addSpawn(Warpgate, 112080, 219568, -3664, 0,
                                     False, 0)
         oldWarpgate1 = self.addSpawn(Warpgate, -16899, 209827, -3640, 0,
                                      False, 0)
         self.Warpgateloc.append(oldWarpgate)
         self.Warpgate1loc.append(oldWarpgate1)
     if self.hellboundLevel >= 1:
         newWarpgate6 = self.addSpawn(32319, 112080, 219568, -3664, 0,
                                      False, 0)
         newWarpgate6 = self.addSpawn(32319, -16899, 209827, -3640, 0,
                                      False, 0)
     if self.hellboundLevel >= 2:
         newFalk = self.addSpawn(32297, -19904, 250016, -3240, 12288, False,
                                 0)
     if self.hellboundLevel >= 3 and self.hellboundLevel < 5:
         self.keltasloc = []
         xx, yy, zz = KeltasSpawn
         newKeltas = self.addSpawn(Keltas, xx, yy, zz, 0, False, 0)
         self.keltasloc.append(newKeltas)
         self.keltasmin = []
         for i in range(31):
             xx, yy, zz = KeltasMinionsSpawns[i]
             RndMobSpawn = KeltasMinions[Rnd.get(len(KeltasMinions))]
             newKeltasMinion = self.addSpawn(RndMobSpawn, xx, yy, zz, 0,
                                             False, 0)
             self.keltasmin.append(newKeltasMinion)
     if self.hellboundLevel == 4:
         newDerek = self.addSpawn(ghostofderek, -28058, 256885, -1934, 0,
                                  False, 0)
     if self.hellboundLevel < 5:
         self.buronloc = []
         self.kiefloc = []
         oldKief = self.addSpawn(Kief, -21271, 250238, -3314, 16384, False,
                                 0)
         oldBuron = self.addSpawn(Buron, -11173, 236537, -3236, 41760,
                                  False, 0)
         self.buronloc.append(oldBuron)
         self.kiefloc.append(oldKief)
     if self.hellboundLevel >= 5:
         newSolomon = self.addSpawn(Solomon, -28916, 249381, -3472, 0,
                                    False, 0)
         newTraitor = self.addSpawn(Traitor, -27352, 252387, -3520, 5416,
                                    False, 0)
         newKief = self.addSpawn(Kief, -28357, 248993, -3472, 16384, False,
                                 0)
         newBuron = self.addSpawn(Buron, -28567, 248994, -3472, 16384,
                                  False, 0)
     if self.hellboundLevel < 6:
         changeBoxesSpawnState(0)
     if self.hellboundLevel < 7:
         changeChimeraSpawnState(0)
     if self.hellboundLevel >= 7:
         #worldObjects = SpawnTable.getInstance().getSpawnTable().values()
         worldObjects = SpawnTable.getInstance().getSpawnTable()
         for i in worldObjects:
             npcId = i.getNpcid()
             if npcId == WLGuard:
                 xx, yy, zz = i.getLocx(), i.getLocy(), i.getLocz()
                 i.stopRespawn()
                 curNpc = i.getLastSpawn()
                 curNpc.onDecay()
     self.startQuestTimer("LevelCheck", 60000, None, None, True)
	def __init__(self, id, name, descr):
		JQuest.__init__(self, id, name, descr)
		self.hellboundTrust = 0
		self.hellboundLevel = 0
		self.hellboundMobs = {
				22320: {'points':10},
				22321: {'points':10},
				22324: {'points':1},
				22325: {'points':1},
				22327: {'points':3},
				22328: {'points':3},
				22329: {'points':3},
		}
		self.hellboundMobs1 = {
				22322: {'points':-10},
				22323: {'points':-10},
				22342: {'points':3},
				22343: {'points':3},
				22361: {'points':20},
				22449: {'points':50},
				22450: {'points':-10},
				25536: {'points':200}
		}
		self.Warpgateloc = []
		self.Warpgate1loc = []
		self.buronloc = []
		self.kiefloc = []
		self.keltasmin = []
		self.keltasloc = []
		self.Keltas = 0
		con = L2DatabaseFactory.getInstance().getConnection()
		trigger = con.prepareStatement("SELECT name FROM hellbound WHERE dummy=0")
		trigger1 = trigger.executeQuery()
		ZoneName = 100
		while (trigger1.next()):
			ZoneName = trigger1.getInt("name")
		try:
			con.close()
		except:
			pass
		if ZoneName != 8000:
			con = L2DatabaseFactory.getInstance().getConnection()
			insertion = con.prepareStatement("INSERT INTO hellbound (name,trustLevel,zonesLevel,unlocked,dummy) VALUES (?,?,?,?,?)")
			insertion.setInt(1, 8000)
			insertion.setInt(2, 0)
			insertion.setInt(3, 0)
			insertion.setInt(4, 0)
			insertion.setInt(5, 0)
			insertion.executeUpdate()
			insertion.close();
			try:
				con.close()
			except:
				pass
		self.hellboundLevel = HellboundManager.getInstance().getLevel()
		self.hellboundTrust = HellboundManager.getInstance().getTrust()
		if self.hellboundLevel == 0:
			self.Warpgateloc = []
			self.Warpgate1loc = []
			oldWarpgate = self.addSpawn(Warpgate, 112080, 219568, -3664, 0, False, 0)
			oldWarpgate1 = self.addSpawn(Warpgate, -16899, 209827, -3640, 0, False, 0)
			self.Warpgateloc.append(oldWarpgate)
			self.Warpgate1loc.append(oldWarpgate1)
		if self.hellboundLevel >= 1:
			newWarpgate6 = self.addSpawn(32319, 112080, 219568, -3664, 0, False, 0)
			newWarpgate6 = self.addSpawn(32319, -16899, 209827, -3640, 0, False, 0)
		if self.hellboundLevel >= 2:
			newFalk = self.addSpawn(32297, -19904, 250016, -3240, 12288, False, 0)
		if self.hellboundLevel >= 3 and self.hellboundLevel < 5:
			self.keltasloc = []
			xx, yy, zz = KeltasSpawn
			newKeltas = self.addSpawn(Keltas, xx, yy, zz, 0, False, 0)
			self.keltasloc.append(newKeltas)
			self.keltasmin = []
			for i in range(31):
				xx, yy, zz = KeltasMinionsSpawns[i]
				RndMobSpawn = KeltasMinions[Rnd.get(len(KeltasMinions))]
				newKeltasMinion = self.addSpawn(RndMobSpawn, xx, yy, zz, 0, False, 0)
				self.keltasmin.append(newKeltasMinion)
		if self.hellboundLevel == 4:
			newDerek = self.addSpawn(ghostofderek, -28058, 256885, -1934, 0, False, 0)
		if self.hellboundLevel < 5:
			self.buronloc = []
			self.kiefloc = []
			oldKief = self.addSpawn(Kief, -21271, 250238, -3314, 16384, False, 0)
			oldBuron = self.addSpawn(Buron, -11173, 236537, -3236, 41760, False, 0)
			self.buronloc.append(oldBuron)
			self.kiefloc.append(oldKief)
		if self.hellboundLevel >= 5:
			newSolomon = self.addSpawn(Solomon, -28916, 249381, -3472, 0, False, 0)
			newTraitor = self.addSpawn(Traitor, -27352, 252387, -3520, 5416, False, 0)
			newKief = self.addSpawn(Kief, -28357, 248993, -3472, 16384, False, 0)
			newBuron = self.addSpawn(Buron, -28567, 248994, -3472, 16384, False, 0)
		if self.hellboundLevel < 6:
			changeBoxesSpawnState(0)
		if self.hellboundLevel < 7:
			changeChimeraSpawnState(0)
		if self.hellboundLevel >= 7:
			worldObjects = SpawnTable.getInstance().getSpawnTable().values()
			for i in worldObjects:
				npcId = i.getNpcid()
				if npcId == WLGuard:
					xx, yy, zz = i.getLocx(), i.getLocy(), i.getLocz()
					i.stopRespawn()
					curNpc = i.getLastSpawn()
					curNpc.onDecay()
		self.startQuestTimer("LevelCheck", 60000, None, None, True)