|
| [Resolue]encore besion d'aide sur du jython^^ | |
| | Auteur | Message |
---|
Spanky
Nombre de messages : 392 Age : 42 Localisation : Osaka, Japon Date d'inscription : 01/12/2007
| Sujet: [Resolue]encore besion d'aide sur du jython^^ 16/10/08, 02:41 pm | |
| voila j'essaye de fixer un script et actuellement il me semble correct pourtant le gs me sort qu'il lui est impossible de lire les details error: gs can read log details emplacement du scripts:C:\gameserver\data\scripts\ai\individual\kingofhill.py le script - Code:
-
#raidboss Spawn event #by Spanky&luna&ezekiel&theone 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 MANAGER = 100400 TOPNPC = 100401 #Change the reward and amount according to your needs Reward = 57 Amount = 300000 #Mountain top NPC coords MNPCX = 144291 MNPCY = 157446 MNPCZ = -466 #Mountain bottom and giran(1) NPC coords MBX1 = 82698 MBY1 = 148638 MBZ1 = -3468 MBX = 143370 MBY = 161135 MBZ = -1925 #number of participants MountainMinPlayers = 6 MountainMaxPlayers = 30 eventInterval = 14400000 # 4 hours after the first event there is the second one and the others after are 4 hours too, change according to your needs FirstStart = 2700000 #45 minutes after each restart there is the first event class kingHill (JQuest): def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) #Bartz self.startQuestTimer("KingHillPrepare", FirstStart, None, None) self.kingHill1 = [] self.Registration = [] self.numberPlayers = [] self.TopNpc = [] self.Team1 = [] self.Team2 = [] self.OrangeLooses = False def onAdvEvent (self,event,npc,player): if event == "KingHillPrepare" : self.kingHill1 = self.addSpawn(MANAGER,MBX1,MBY1,MBZ1,0,False,0) self.TopNpc = self.addSpawn(TOPNPC,MNPCX,MNPCY,MNPCZ,0,False,0) self.Registration = [] Announcements.getInstance().announceToAll("King of the hill event registration is open!!") Announcements.getInstance().announceToAll("All those who wish to participate should come to meet me in Giran town") Announcements.getInstance().announceToAll("Registration will last 15 minutes") self.startQuestTimer("MountainSelect", 900000, None, None) self.startQuestTimer("10minutes", 300000, None, None) self.startQuestTimer("5minutes", 600000, None, None) self.startQuestTimer("2minutes", 780000, None, None) self.startQuestTimer("1minute", 840000, None, None) if event == "MountainSelect" : self.kingHill1.deleteMe() self.startQuestTimer("MountainStart", 5000, None, None) totalplayers = len(self.Registration) if totalplayers >= MountainMinPlayers: self.numberOfTeams = int((len(self.Registration))/2) numberOfTeams = int((len(self.Registration))/2) Id = [] #this part will remove anyone from the registration list who is not online when the event starts, this prevents players from cheating by registering a bunch of characters but playing only with one and getting the reward for all of their characters who were on the winning team even if these are not online during the event. for i in self.Registration: rr = i.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]) self.OrangeLooses = False Team1 = [] Team2 = [] for i in range(len(self.Registration)/2) : Team1.append(self.Registration.pop(Rnd.get(len(self.Registration)))) Team2 = self.Registration for i in Team1: i.teleToLocation(MNPCX,MNPCY,MNPCZ)#tele to top of mountain i.getAppearance().setNameColor(0x005de2) #orange i.getAppearance().setTitleColor(0x005de2) #orange for i in Team2: i.teleToLocation(144428,161151,-2460)#tele to location A i.getAppearance().setNameColor(0xd5e200) #yellow i.getAppearance().setTitleColor(0xd5e200) #yellow Announcements.getInstance().announceToAll("Team 1 - blue - has 20 minutes to take control of the mountain and talk to the Flag NPC to win this event.") Announcements.getInstance().announceToAll("Team 2 - orange - has to defend the mountain to win. Event starts in 1 minute, wait for the signal.") self.Team1 = [] self.Team2 = [] self.Team1 = Team1 self.Team2 = Team2 else: Announcements.getInstance().announceToAll("Event cancelled due to lack of participation.") self.kingHill1.deleteMe() self.TopNpc.deleteMe() self.cancelQuestTimer("round_finish", None, None) self.cancelQuestTimer("15Tofinish", None, None) self.cancelQuestTimer("10Tofinish", None, None) self.cancelQuestTimer("5Tofinish", None, None) self.cancelQuestTimer("1Tofinish", None, None) if event == "MountainStart": for i in self.Team2: i.teleToLocation(MBX,MBY,MBZ)#tele to location A Announcements.getInstance().announceToAll("Start the event!!! Team 2, ATTACK!!! Good luck to both teams!") self.startQuestTimer("round_finish", 1200000, None, None) #sera 1200000 self.startQuestTimer("15Tofinish", 300000, None, None) self.startQuestTimer("10Tofinish", 600000, None, None) self.startQuestTimer("5Tofinish", 900000, None, None) self.startQuestTimer("1Tofinish", 1140000, None, None) if event == "15Tofinish": Announcements.getInstance().announceToAll("15 minutes until the end of the event") if event == "10Tofinish": Announcements.getInstance().announceToAll("10 minutes until the end of the event") if event == "5Tofinish": Announcements.getInstance().announceToAll("5 minutes until the end of the event") if event == "1Tofinish": Announcements.getInstance().announceToAll("1 minute until the end of the event") if event == "round_finish" and npc and player: if self.OrangeLooses == False: self.TopNpc.deleteMe() self.startQuestTimer("EventTrigger", eventInterval, None, None) self.cancelQuestTimer("15Tofinish", None, None) self.cancelQuestTimer("10Tofinish", None, None) self.cancelQuestTimer("5Tofinish", None, None) self.cancelQuestTimer("1Tofinish", None, None) Announcements.getInstance().announceToAll("Orange team wins!") rr = self.Event reward = self.rewards for i in self.Team2: rr = (Rnd.get(100) - 50) xx = MBX1 + rr yy = MBY1 + rr i.getAppearance().setNameColor(0xffffff) i.getAppearance().setTitleColor(0xffffff) i.teleToLocation(xx,zz,MBZ1)#tele back to town for i in self.Team1: rr = (Rnd.get(100) - 50) xx = MBX1 + rr yy = MBY1 + rr i.getQuestState("kingHill").giveItems(Reward,Amount) i.getQuestState("kingHill").playSound("ItemSound.quest_fanfare_1") i.getAppearance().setNameColor(0xffffff) i.getAppearance().setTitleColor(0xffffff) i.teleToLocation(xx,zz,MBZ1)#tele back to town if event == "10minutes": Announcements.getInstance().announceToAll("10 minutes left for event registration in Giran") if event == "5minutes": Announcements.getInstance().announceToAll("5 minutes left for event registration in Giran") if event == "2minutes": Announcements.getInstance().announceToAll("2 minutes left for event registration in Giran") if event == "1minutes": Announcements.getInstance().announceToAll("1 minute left for event registration in Giran") def onTalk (self,npc,player) : npcId = npc.getNpcId() if not player.getQuestState("kingHill") : return if npcId == MANAGER : if not player in self.Registration: if len(self.Registration) < MountainMaxPlayers: 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]) return "<html><body>You have been added to the event list, teams will be made randomly 1 minute before the start of the event</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>" if npcId == TOPNPC : if player in self.Team2: self.TopNpc.deleteMe() self.OrangeLooses = True self.cancelQuestTimer("round_finish", None, None) self.cancelQuestTimer("5Tofinish", None, None) self.cancelQuestTimer("1Tofinish", None, None) Announcements.getInstance().announceToAll("Blue team wins!") rr = self.Event reward = self.rewards self.startQuestTimer("EventTrigger", eventInterval, None, None) for i in self.Team1: rr = (Rnd.get(100) - 50) xx = MBX1 + rr yy = MBY1 + rr i.getAppearance().setNameColor(0xffffff) i.getAppearance().setTitleColor(0xffffff) i.teleToLocation(xx,zz,MBZ1)#tele back to town for i in self.Team2: rr = (Rnd.get(100) - 50) xx = MBX1 + rr yy = MBY1 + rr i.getQuestState("kingHill").playSound("ItemSound.quest_fanfare_1") i.getQuestState("kingHill").giveItems(Reward,Amount) i.getAppearance().setNameColor(0xffffff) i.getAppearance().setTitleColor(0xffffff) i.teleToLocation(xx,zz,MBZ1)#tele back to town if player in self.Team1: return "<html><body>You are on the defending team!!! Defend me, stop talking!</body></html>" else: player.sendMessage("You are trying to cheat, you will now go to jail to think about this") player.setInJail(True,10) #sends the cheater to jail for 10 minutes so he can think about this... QUEST = kingHill(-1, "kingHill", "ai") QUEST.addStartNpc(100400) QUEST.addStartNpc(100401) QUEST.addTalkId(100400) QUEST.addTalkId(100401) print "King of the Hill event loaded!!!"
Dernière édition par Spanky le 16/10/08, 08:27 pm, édité 1 fois | |
| | | Spanky
Nombre de messages : 392 Age : 42 Localisation : Osaka, Japon Date d'inscription : 01/12/2007
| Sujet: Re: [Resolue]encore besion d'aide sur du jython^^ 16/10/08, 02:43 pm | |
| le htm des npc 100400 - Code:
-
1. <html> 2. <body> 3. <center> 4. <img src="L2UI_CH3.herotower_deco" width=256 height=32> 5. <br>So... you want to participate in the event? 6. <br><br> 7. <button value="Yes!" action="bypass -h npc_%objectId%_Quest kingofhill" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"> 8. <img src=Sek.start_logo width=256 height=256 align=center> 9. </center></body> 10. </html> 100401.htm - Code:
-
1. <html> 2. <body> 3. <center> 4. <img src="L2UI_CH3.herotower_deco" width=256 height=32> 5. <br>hmmm... it seems you have defeted my defenders... So, you want your reward then? 6. <br><br> 7. <button value="Yes we do!" action="bypass -h npc_%objectId%_Quest kingofhill" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"> 8. <img src=Sek.start_logo width=256 height=256 align=center> 9. </center></body> 10. </html> | |
| | | Spanky
Nombre de messages : 392 Age : 42 Localisation : Osaka, Japon Date d'inscription : 01/12/2007
| Sujet: Re: [Resolue]encore besion d'aide sur du jython^^ 16/10/08, 02:44 pm | |
| le karma fix - Code:
-
1. insert into zone_vertices values 2. ('25100', '0', '143314', '164544'), 3. ('25100', '1', '144215', '160270'), 4. ('25100', '2', '145877', '159158'), 5. ('25100', '3', '145397', '158735'), 6. ('25100', '4', '142822', '155102'), 7. ('25100', '5', '140831', '158004'), 8. ('25100', '6', '141794', '160570'); | |
| | | Spanky
Nombre de messages : 392 Age : 42 Localisation : Osaka, Japon Date d'inscription : 01/12/2007
| Sujet: Re: [Resolue]encore besion d'aide sur du jython^^ 16/10/08, 02:45 pm | |
| la zone.xml - Code:
-
# <zone id='25100' type='Arena' shape='Npoly' minZ='-2100' maxZ='-100'> # <stat name='name' val='Special Mountain Arena'/> # <stat name='spawnX' val='-59858'/> # <stat name='spawnY' val='-57495'/> # <stat name='spawnZ' val='-2039'/> # </zone> quelqu'un aurait une id de ou sa cloche car la je pige plus rien | |
| | | Yoco
Nombre de messages : 549 Age : 41 Localisation : Près du bonheur, celui d'un rêve... Date d'inscription : 09/03/2007
| Sujet: Re: [Resolue]encore besion d'aide sur du jython^^ 16/10/08, 07:39 pm | |
| Salutation,
Je sais c'est un détail, toute fois je pense que tu n'as pas du l'oublier. Mais je préfère quand même le demander. As-tu bien mis le chemin d'accé dans scripts.cfg : ai/individual/kingofhill.py ?
Pour ce qui est du reste, je n'ai pas encore regardé en détail le reste de la programmation.
Amicalement | |
| | | Respawner
Nombre de messages : 1620 Age : 36 Date d'inscription : 20/04/2006
| Sujet: Re: [Resolue]encore besion d'aide sur du jython^^ 16/10/08, 07:44 pm | |
| Tu as remarqué que chez L2JDP les AI sont en Java ? Ca serait peut être judicieux de réaliser la tienne en Java aussi alors. Question d'évolution pour plus tard ... | |
| | | Yoco
Nombre de messages : 549 Age : 41 Localisation : Près du bonheur, celui d'un rêve... Date d'inscription : 09/03/2007
| Sujet: Re: [Resolue]encore besion d'aide sur du jython^^ 16/10/08, 08:08 pm | |
| Re,
Oui exact, cela dépends des datas, en effet elle est sous L2J, donc je confirme bien tes propos sous : ai/individual/kingofhill.java
Amicalement | |
| | | Spanky
Nombre de messages : 392 Age : 42 Localisation : Osaka, Japon Date d'inscription : 01/12/2007
| Sujet: Re: [Resolue]encore besion d'aide sur du jython^^ 16/10/08, 08:26 pm | |
| cetait tout bete mais cetait sa :d, java quand tu les tient j'ai trop honte | |
| | | Spanky
Nombre de messages : 392 Age : 42 Localisation : Osaka, Japon Date d'inscription : 01/12/2007
| Sujet: Re: [Resolue]encore besion d'aide sur du jython^^ 16/10/08, 08:28 pm | |
| - Yoco a écrit:
- Salutation,
Je sais c'est un détail, toute fois je pense que tu n'as pas du l'oublier. Mais je préfère quand même le demander. As-tu bien mis le chemin d'accé dans scripts.cfg : ai/individual/kingofhill.py ?
Pour ce qui est du reste, je n'ai pas encore regardé en détail le reste de la programmation.
Amicalement | |
| | | Contenu sponsorisé
| Sujet: Re: [Resolue]encore besion d'aide sur du jython^^ | |
| |
| | | | [Resolue]encore besion d'aide sur du jython^^ | |
|
Sujets similaires | |
|
Sujets similaires | |
| |
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |