| | [Résolue](merci de votre aide)juste une question bete | |
|
+4Respawner Skatershi Grimly Spanky 8 participants | |
Auteur | Message |
---|
Spanky
Nombre de messages : 392 Age : 42 Localisation : Osaka, Japon Date d'inscription : 01/12/2007
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete 25/10/08, 02:30 pm | |
| | |
| | | Respawner
Nombre de messages : 1620 Age : 35 Date d'inscription : 20/04/2006
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete 25/10/08, 02:42 pm | |
| Rien à voir avec ton script ... A moins que tu tentes de deleteMe() un joueur peut être | |
| | | Spanky
Nombre de messages : 392 Age : 42 Localisation : Osaka, Japon Date d'inscription : 01/12/2007
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete 25/10/08, 04:45 pm | |
| sa ma msi sa a ma connection jsute apres que jai changer el delete pigs par el delete id | |
| | | Respawner
Nombre de messages : 1620 Age : 35 Date d'inscription : 20/04/2006
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete 25/10/08, 04:53 pm | |
| - Spanky a écrit:
- sa ma msi sa a ma connection jsute apres que jai changer el delete pigs par el delete id
Reformule moi ça s'il te plait j'ai pas compris. | |
| | | Grimly
Nombre de messages : 601 Date d'inscription : 30/08/2007
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete 25/10/08, 05:19 pm | |
| - Spanky a écrit:
- sa ma msi sa a ma connection jsute apres que jai changer el delete pigs par el delete id
Woaw l'horreur ! Spanky, retourne au CE2 et suis les cours de français cette fois-ci !!! | |
| | | Spanky
Nombre de messages : 392 Age : 42 Localisation : Osaka, Japon Date d'inscription : 01/12/2007
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete 25/10/08, 05:52 pm | |
| - Grimly a écrit:
- Spanky a écrit:
- sa ma msi sa a ma connection jsute apres que jai changer el delete pigs par el delete id
Woaw l'horreur ! Spanky, retourne au CE2 et suis les cours de français cette fois-ci !!! j'ai pas fait français en ce2, y'a pas sa au primaire.sumimasens sa ma mis cela a la connexion juste après que j’ai changer le délecte pigs par le délecte id | |
| | | Respawner
Nombre de messages : 1620 Age : 35 Date d'inscription : 20/04/2006
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete 25/10/08, 05:59 pm | |
| Poste ton code actuel, je comprend pas ton histoire de delete. | |
| | | Jules
Nombre de messages : 384 Localisation : Rome Date d'inscription : 11/04/2008
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete 25/10/08, 06:00 pm | |
| Tu sais, même traduit, c'est pas plus clair... - La traduction a écrit:
- Ca m'a mit cela à la connexion juste après que j’ai changé le [...]
La suite, le délecte pigs et le délecte id, impossible de savoir de quoi tu causes. | |
| | | Skatershi
Nombre de messages : 1305 Age : 35 Date d'inscription : 09/11/2006
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete 26/10/08, 02:45 am | |
| Au pire essaye d'expliquer ton soucis en anglais Spanky. Nous sommes sur un forum français, mais pour une fois on peut faire une petite exception hein... | |
| | | Respawner
Nombre de messages : 1620 Age : 35 Date d'inscription : 20/04/2006
| | | | Spanky
Nombre de messages : 392 Age : 42 Localisation : Osaka, Japon Date d'inscription : 01/12/2007
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete 27/10/08, 03:59 pm | |
| I seek to create a event. which must be spawn monsters in all town (small pigs). for the moments he spawn all pigs in all castle town and npc manager too but at the end of the event I can not make them disappear automatically - Code:
-
#Smash The Pigs event #by TheOne, edit by spanky&seva
import math import sys from net.sf.l2j.gameserver import Announcements from net.sf.l2j.util import Rnd from java.lang import System from net.sf.l2j.gameserver.model.quest import State from net.sf.l2j.gameserver.model.quest import QuestState from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance from net.sf.l2j.gameserver.model.actor.instance import L2NpcInstance from net.sf.l2j.gameserver.network.serverpackets import PlaySound #Put the Id of the reward of your choice here Reward = 57 #Put the amount to give of this reward depending on the player level like this: [ level35amount,level65amount,level80amount ] Amount = [ 300000,1000000 ,5000000 ] #change the reward! :) MANAGER = 50026 #choose the NPC that you want (100500) ManagerLocX = [ 147453,82698,82753,16105,111257,-14403,147714,87354,-81085,116498,17471,43594,45854,11523,-83980,115170,-44534,-116065 ] ManagerLocY = [ 26917,148638,53578,143272,219998,123388,-56380,-142315,150613,76137,169987,-48161,49768,16835,242577,-179018,-112910,46172 ] ManagerLocZ = [ -2205,-3468,-1496,-2771,-3671,-3117,-2781,-1341,-3044,-2730,-3502,-797,-3060,-4662,-3730,-911,-240,504 ] #NPC coords in Giran MBX1 = 82698 MBY1 = 148638 MBZ1 = -3468
#addon added by sevas PigMaxPlayers = 30 # (max number of players, NOT TESTED YET) repeat = 3600000 # event repeat (Default 1 hour) unspawntime = 10000 # This remove pigs again 10 sec later when players are teleported (no change) teleportback = 605000 # Teleport player back to giran (5 sec more than duracion) duracion = 600000 # length of the event (Default 10min) finishtime = 600000 # Announcement in game when event finish FirstStart = 20000 # when server start/restart the event 'll load after this time Pigs = [ 100307,100308,100309,100310,100311,100312,100313,100314,100315 ] # 3 levels, 3 of each level in order - 35,65,80 SpawnXLowTown = [ 46264,12940,-84766,116618,-44567,-115572 ] SpawnYLowTown = [ 49679,16484,242338,-182496,-112683,46779 ] SpawnZLowTown = [ -3068,-4585,-3730,-1526,-240,501 ] SpawnXMidTown = [ -14403,-82335,116682,45375 ] SpawnYMidTown = [ 123631,150831,76407,-47863 ] SpawnZMidTown = [ -3117,-3129,-2730,-797 ] SpawnXHighTown = [ 148051,81348,82435,18809,111921,148416,88144 ] SpawnYHighTown = [ 28045,148238,53681,145310,219691,-55977,-142741 ] SpawnZHighTown = [ -2269,-3469,-1496,-3131,-3761,-2781,-1341 ] class pigsSmash (JQuest): def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) self.startQuestTimer("PigsSpawn", FirstStart, None, None) self.EventManager1 = [] self.Registration = [] self.Pigs = [] def onTalk (self,npc,player) : npcId = npc.getNpcId() if not player.getQuestState("pigsSmash") : return if npcId == MANAGER : if not player in self.Registration: if len(self.Registration) < PigMaxPlayers: self.Registration.append(player) Reg = list(self.Registration) Id = [] for player in self.Registration: rr = player.getClient() if rr == None: for i in range(len(self.Registration)): if player == self.Registration[i]: Id.append[i] if len(Id) > 1: for i in range(len(Id)): self.Registration.pop(Id[i]) player.sendPacket(PlaySound("ItemSound.quest_accept")) return "<html><body>You are now participating in the event! Go and kill some Pigs!!</body></html>" else: self.Full = True return "<html><body>Event is full, try again next time ;)</body></html>" else: return "<html><body>You are already registered.</body></html>" def onAdvEvent (self,event,npc,player): if event == "PigsSpawn": StartAnnounce = "Some special pigs have been spawned in all towns and villages. Their levels should reflect the Town that they are in." StartAnnounce2 = "When killed, there is a chance that they will drop an event box." StartAnnounce3 = "If you are 10 or more levels higher than the Pig that you kill, you will not get any reward." StartAnnounce4 = "You need to register with the Event Manager in a town to participate!" Announcements.getInstance().announceToAll(StartAnnounce) Announcements.getInstance().announceToAll(StartAnnounce2) Announcements.getInstance().announceToAll(StartAnnounce3) Announcements.getInstance().announceToAll(StartAnnounce4) self.Registration = [] self.startQuestTimer("PigDespawn", duracion, None, None) #StartTimer de la Duracion self.startQuestTimer("finish", finishtime, None, None) #StartTimer del anuncio finish self.startQuestTimer("teleportback", teleportback, None, None) #StartTimer del teleportback for i in range(len(ManagerLocX)): manager1 = self.addSpawn(MANAGER,ManagerLocX[i],ManagerLocY[i],ManagerLocZ[i],0,False,0) self.EventManager1.append(manager1) for i in range(15): for i in range(len(SpawnXLowTown)): rr = Rnd.get(500) rr2 = Rnd.get(500) xx = SpawnXLowTown[i] + (rr - 250) yy = SpawnYLowTown[i] + (rr2 - 250) zz = SpawnZLowTown[i] luck = Rnd.get(3) pig = self.addSpawn(Pigs[luck],xx,yy,zz,0,False,0) self.Pigs.append(pig) for i in range(len(SpawnXMidTown)): rr = Rnd.get(500) rr2 = Rnd.get(500) xx = SpawnXMidTown[i] + (rr - 250) yy = SpawnYMidTown[i] + (rr2 - 250) zz = SpawnZMidTown[i] luck = Rnd.get(3) luck = luck + 3 pig = self.addSpawn(Pigs[luck],xx,yy,zz,0,False,0) self.Pigs.append(pig) for i in range(len(SpawnXHighTown)): rr = Rnd.get(500) rr2 = Rnd.get(500) xx = SpawnXHighTown[i] + (rr - 250) yy = SpawnYHighTown[i] + (rr2 - 250) zz = SpawnZHighTown[i] luck = Rnd.get(3) luck = luck + 6 pig = self.addSpawn(Pigs[luck],xx,yy,zz,0,False,0) self.Pigs.append(pig) if event == "finish": StartAnnounce5 = "Smash The Pigs Event Finished" StartAnnounce6 = "The next event is on X hour" Announcements.getInstance().announceToAll(StartAnnounce5) Announcements.getInstance().announceToAll(StartAnnounce6) if event == "PigDespawn": #First unspawn of npcs print "[Event] Smash The Pig Event Finished" [color=red]for npc in self.Pigs: npc.deleteMe() for npc in self.EventManager1: npc.deleteMe()[/color] self.startQuestTimer("unspawntime", unspawntime, None, None) #StartTimer of second unspawn if event == "teleportback": #Teleport players back to giran print "[Event] Teleporting Players" for player in self.Registration: player.teleToLocation(82823,148605,-3469) if event == "unspawntime": #Second unspawn print "[Event] Removing Pigs" for npc in self.Pigs: npc.deleteMe() print "[Event] Pigs Removed" self.startQuestTimer("PigsSpawn", repeat, None, None) #StartTimer (old eventInterval) print "[Event] Next event is in X hour" def onKill(self,npc,player,isPet): npcId = npc.getNpcId() npcObjId = npc.getObjectId() if npc in self.Pigs: level = npc.getLevel() xx = npc.getX() yy = npc.getY() zz = npc.getZ() luck = Rnd.get(3) if level == 35: prize_amount = Amount[0] if level == 65: luck = luck + 3 prize_amount = Amount[1] if level == 80: luck = luck + 6 prize_amount = Amount[2] for i in range(len(self.Pigs)): if npcObjId == self.Pigs[i].getObjectId(): Id = i self.Pigs.pop(Id) pig = self.addSpawn(Pigs[luck],xx,yy,zz,0,False,0) self.Pigs.append(pig) if not player.getQuestState("pigsSmash"): return if player.getLevel() > (level + 9): player.teleToLocation(82823,148605,-3469) return if player in self.Registration: #If the player registered than he has the quest, no need to check if Rnd.get(101) <= 5: #5% chance that it will drop a reward, change if you need to player.getQuestState("pigsSmash").giveItems(Reward,prize_amount ) player.sendPacket(PlaySound("ItemSound.quest_itemget")) else: player.teleToLocation(82823,148605,-3469) return "<html><body>You are not allowed to hunt pigs! Go back and Register with the NPC Bonny and you will be allowed to participate in the event.</body></html>" QUEST = pigsSmash(-1, "pigsSmash", "ai") for i in Pigs: QUEST.addKillId(i) QUEST.addStartNpc(MANAGER) QUEST.addTalkId(MANAGER) print "Smash the pigs event loaded!!!" | |
| | | Respawner
Nombre de messages : 1620 Age : 35 Date d'inscription : 20/04/2006
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete 27/10/08, 04:16 pm | |
| So what kind of error do you have? and when? | |
| | | Spanky
Nombre de messages : 392 Age : 42 Localisation : Osaka, Japon Date d'inscription : 01/12/2007
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete 27/10/08, 06:37 pm | |
| | |
| | | Respawner
Nombre de messages : 1620 Age : 35 Date d'inscription : 20/04/2006
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete 27/10/08, 06:51 pm | |
| You need to understand why do you have a None type error (same as null pointer in Java). Spawn doesn't exist for example or just your list which is empty.
This is one of the thing which makes me don't like Python. the type of the attribute isn't "defined" by the programer. Make the same script in Java and you will not do this kind of error. | |
| | | Spanky
Nombre de messages : 392 Age : 42 Localisation : Osaka, Japon Date d'inscription : 01/12/2007
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete 06/11/08, 01:42 pm | |
| - Code:
-
self.startQuestTimer("PigDespawn", 2700000, None, None) for i in range(len(ManagerLocX)): manager1 = self.addSpawn(MANAGER,ManagerLocX[i],ManagerLocY[i],ManagerLocZ[i],0,False,0) self.EventManager1.append(manager1) for i in range(15): for i in range(len(SpawnXLowTown)): rr = Rnd.get(500) rr2 = Rnd.get(500) xx = SpawnXLowTown[i] + (rr - 250) yy = SpawnYLowTown[i] + (rr2 - 250) zz = SpawnZLowTown[i] luck = Rnd.get(3) pig = self.addSpawn(Pigs[luck],xx,yy,zz,0,False,0) self.Pigs.append(pig) for i in range(len(SpawnXMidTown)): rr = Rnd.get(500) rr2 = Rnd.get(500) xx = SpawnXMidTown[i] + (rr - 250) yy = SpawnYMidTown[i] + (rr2 - 250) zz = SpawnZMidTown[i] luck = Rnd.get(3) luck = luck + 3 pig = self.addSpawn(Pigs[luck],xx,yy,zz,0,False,0) self.Pigs.append(pig) for i in range(len(SpawnXHighTown)): rr = Rnd.get(500) rr2 = Rnd.get(500) xx = SpawnXHighTown[i] + (rr - 250) yy = SpawnYHighTown[i] + (rr2 - 250) zz = SpawnZHighTown[i] luck = Rnd.get(3) luck = luck + 6 pig = self.addSpawn(Pigs[luck],xx,yy,zz,0,False,0) self.Pigs.append(pig) if event == "PigDespawn": print "removing Pigs" self.startQuestTimer("PigSpawn", eventInterval, None, None) self.EventManager1.deleteMe() for i in range(len(self.Pigs)): self.Pigs[i].deleteMe() | |
| | | Contenu sponsorisé
| Sujet: Re: [Résolue](merci de votre aide)juste une question bete | |
| |
| | | | [Résolue](merci de votre aide)juste une question bete | |
|
Sujets similaires | |
|
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |