Jump to content

Recommended Posts

Posted

Hi MXc . Ive go some problem whit paiala lvl73-75. It was deleted missing or something like that. Ive serched this quest on this forum but nothing.

And I want to share

144_PailakaInjuredDragon
/
__init__.pyimport sys 
3	from com.l2jserver.gameserver.datatables            import SkillTable 
4	from com.l2jserver.gameserver.instancemanager       import InstanceManager 
5	from com.l2jserver.gameserver.model.actor.instance  import L2PcInstance 
6	from com.l2jserver.gameserver.model.entity               import Instance 
7	from com.l2jserver.gameserver.model.quest           import State 
8	from com.l2jserver.gameserver.model.quest           import QuestState 
9	from com.l2jserver.gameserver.model.quest.jython    import QuestJython as JQuest 
10	from com.l2jserver.gameserver.network.serverpackets import PlaySound 
11	from com.l2jserver.util                             import Rnd 
12	
13	qn = "144_PailakaInjuredDragon" 
14	
15	#NPC 
16	KETRAOSHAMAN = 32499 
17	KOSUPPORTER  = 32502 
18	KOIO         = 32509 
19	KOSUPPORTER2 = 32512 
20	Pailaka3rd   = [18635,18636,18638,18639,18640,18641,18642,18644,18645,18646,18648,18649,18650,18652,18653,18654,18655,18656,18657,18658,18659] 
21	Antelopes    = [18637,18643,18647,18651] 
22	#BOSS 
23	LATANA    = 18660 
24	#ITEMS 
25	SPEAR     = 13052 
26	ENCHSPEAR = 13053 
27	LASTSPEAR = 13054 
28	STAGE1    = 13056 
29	STAGE2    = 13057 
30	PAILAKA3DROP = [8600,8601,8603,8604] 
31	ANTELOPDROP  = [13032,13033] 
32	#REWARDS 
33	PSHIRT    = 13296 
34	#ETC 
35	AMOUNTS1  = [1,2,3,4,5,6,7,8,9,10] 
36	
37	BUFFS={ 
38	"1":[4357,2],#Haste Lv2 
39	"2":[4342,2],#Wind Walk Lv2 
40	"3":[4356,3],#Empower Lv3 
41	"4":[4355,3],#Acumen Lv3 
42	"5":[4351,6],#Concentration Lv6 
43	"6":[4345,3],#Might Lv3 
44	"7":[4358,3],#Guidance Lv3 
45	"8":[4359,3],#Focus Lv3 
46	"9":[4360,3],#Death Wisper Lv3 
47	"10":[4352,2],#Berserker Spirit Lv2 
48	"11":[4354,4],#Vampiric Rage Lv4 
49	"12":[4347,6],#Blessed Body Lv6 
50	} 
51	
52	def isWithinLevel(player): 
53	         if player.getLevel() > 77: 
54	                 return False 
55	         if player.getLevel() < 73: 
56	                 return False 
57	         return True 
58	
59	class Quest (JQuest): 
60	
61	 def __init__(self,id,name,descr): 
62	     JQuest.__init__(self,id,name,descr) 
63	     self.questItemIds = [sTAGE1,STAGE2,SPEAR,ENCHSPEAR,LASTSPEAR,13033,13032] 
64	     self.currentWorld = 0 
65	     self.KilledMobs = 0 
66	     self.Action = {} 
67	
68	 def onAdvEvent (self,event,npc,player) : 
69	     st = player.getQuestState(qn) 
70	     if not st: return 
71	     if str(event) in BUFFS.keys(): 
72	         skillId,level=BUFFS[event] 
73	         playerName = player.getName() 
74	         if self.Action[playerName]['times'] < 4: 
75	             npc.setTarget(player) 
76	             npc.doCast(SkillTable.getInstance().getInfo(skillId,level)) 
77	             self.Action[playerName]['times'] += 1 
78	             htmltext = "32509-06.htm" 
79	             return htmltext 
80	         if self.Action[playerName]['times'] == 4: 
81	             npc.setTarget(player) 
82	             npc.doCast(SkillTable.getInstance().getInfo(skillId,level)) 
83	             self.Action[playerName]['times'] = 5 
84	             htmltext = "32509-05.htm" 
85	             return htmltext 
86	     if event == "Support": 
87	         playerName = player.getName() 
88	         if not playerName in self.Action: 
89	                     htmltext = "32509-06.htm" 
90	                     self.Action[playerName] = {} 
91	                     self.Action[playerName]['times'] = 0 
92	         if playerName in self.Action: 
93	             if self.Action[playerName]['times'] < 5: 
94	                 htmltext = "32509-06.htm" 
95	         if self.Action[playerName]['times'] >= 5: 
96	             htmltext = "32509-04.htm" 
97	         return htmltext 
98	     cond = st.getInt("cond") 
99	     htmltext = event 
100	     if event == "32499-02.htm": 
101	             st.set("cond","1") 
102	             st.setState(State.STARTED) 
103	             st.playSound("ItemSound.quest_accept") 
104	     elif event == "32499-05.htm": 
105	             st.set("cond","2") 
106	             st.playSound("ItemSound.quest_accept") 
107	     elif event == "32502-05.htm": 
108	                 st.set("cond","3") 
109	                 st.playSound("ItemSound.quest_middle") 
110	                 st.giveItems(SPEAR,1) 
111	     elif event == "32512-02.htm": 
112	             st.takeItems(SPEAR,1) 
113	             st.takeItems(ENCHSPEAR,1) 
114	             st.takeItems(LASTSPEAR,1) 
115	     return htmltext 
116	
117	
118	 def onTalk (self,npc,player): 
119	     npcId = npc.getNpcId() 
120	     htmltext = "32499-01.htm" 
121	     st = player.getQuestState(qn) 
122	     if not st: return htmltext 
123	     id = st.getState() 
124	     cond = st.getInt("cond") 
125	     playerName = player.getName() 
126	     if id == State.CREATED: 
127	         st.setState(State.STARTED) 
128	         st.set("cond","0") 
129	     if npcId == KETRAOSHAMAN: 
130	             if cond == 0 and id == State.STARTED: 
131	                     if not isWithinLevel(player): 
132	                             htmltext = "32499-no.htm" 
133	                             st.exitQuest(1) 
134	                     else: 
135	                             self.Action[playerName] = {} 
136	                             self.Action[playerName]['times'] = 0 
137	                             return htmltext 
138	             elif id == State.COMPLETED: 
139	                     htmltext = "32499-no.htm" 
140	             elif cond == 1 or cond == 2 or cond == 3: 
141	                     htmltext = "32499-06.htm" 
142	             else: 
143	                     htmltext = "32499-07.htm" 
144	     elif npcId == KOSUPPORTER: 
145	             if cond == 1 or cond == 2: 
146	                     htmltext = "32502-01.htm" 
147	             else: 
148	                     htmltext = "32502-05.htm" 
149	     elif npcId == KOIO: 
150	             if st.getQuestItemsCount(SPEAR) > 0 and st.getQuestItemsCount(STAGE1) == 0: htmltext = "32509-01.htm" 
151	             if st.getQuestItemsCount(ENCHSPEAR) > 0 and st.getQuestItemsCount(STAGE2) == 0: htmltext = "32509-01.htm" 
152	             if st.getQuestItemsCount(SPEAR) == 0 and st.getQuestItemsCount(STAGE1) > 0: htmltext = "32509-07.htm" 
153	             if st.getQuestItemsCount(ENCHSPEAR) == 0 and st.getQuestItemsCount(STAGE2) > 0: htmltext = "32509-07.htm" 
154	             if st.getQuestItemsCount(SPEAR) == 0 and st.getQuestItemsCount(ENCHSPEAR) == 0: htmltext = "32509-07.htm" 
155	             if st.getQuestItemsCount(STAGE1) == 0 and st.getQuestItemsCount(STAGE2) == 0: htmltext = "32509-01.htm" 
156	             if st.getQuestItemsCount(SPEAR) > 0 and st.getQuestItemsCount(STAGE1) > 0: 
157	                     st.takeItems(SPEAR,1) 
158	                     st.takeItems(STAGE1,1) 
159	                     st.giveItems(ENCHSPEAR,1) 
160	                     htmltext = "32509-02.htm" 
161	             if st.getQuestItemsCount(ENCHSPEAR) > 0 and st.getQuestItemsCount(STAGE2) > 0: 
162	                     st.takeItems(ENCHSPEAR,1) 
163	                     st.takeItems(STAGE2,1) 
164	                     st.giveItems(LASTSPEAR,1) 
165	                     htmltext = "32509-03.htm" 
166	             if st.getQuestItemsCount(LASTSPEAR) > 0: htmltext = "32509-03.htm" 
167	     elif npcId == KOSUPPORTER2: 
168	             if cond == 4: 
169	                         st.giveItems(736,1) 
170	                         st.takeItems(13032,st.getQuestItemsCount(13032)) 
171	                         st.takeItems(13033,st.getQuestItemsCount(13033)) 
172	                         st.giveItems(PSHIRT,1) 
173	                         st.addExpAndSp(28000000, 2850000) 
174	                         st.set("cond","5") 
175	                         st.setState(State.COMPLETED) 
176	                         st.playSound("ItemSound.quest_finish") 
177	                         st.exitQuest(False) 
178	                         instanceObj = InstanceManager.getInstance().getInstance(player.getInstanceId()) 
179	                         instanceObj.setDuration(300000) 
180	                         htmltext = "32512-01.htm" 
181	                         player.setVitalityPoints(20000,true) 
182	             elif id == State.COMPLETED: 
183	                     htmltext = "32512-03.htm" 
184	     return htmltext 
185	    
186	 def onKill(self,npc,player,isPet): 
187	     st = player.getQuestState(qn) 
188	     if not st: return 
189	     npcId = npc.getNpcId() 
190	     cond = st.getInt("cond") 
191	     if npcId == 18654: 
192	             if st.getQuestItemsCount(STAGE1) < 1 and st.getQuestItemsCount(SPEAR) > 0: 
193	                     st.giveItems(STAGE1,1) 
194	     elif npcId == 18649 and st.getQuestItemsCount(ENCHSPEAR) > 0: 
195	             if st.getQuestItemsCount(STAGE2) < 1: 
196	                     st.giveItems(STAGE2,1) 
197	     elif npcId == LATANA: 
198	             st.set("cond","4") 
199	             st.playSound("ItemSound.quest_middle") 
200	             Dwarf = self.addSpawn(KOSUPPORTER2,npc.getX(),npc.getY(),npc.getZ(),npc.getHeading(),False,0,False,npc.getInstanceId()) 
201	     elif npcId in Pailaka3rd: 
202	             if Rnd.get(100) < 30: 
203	                     st.dropItem(npc,player,PAILAKA3DROP[Rnd.get(len(PAILAKA3DROP))],1) 
204	     elif npcId in Antelopes: 
205	             st.dropItem(npc,player,ANTELOPDROP[Rnd.get(len(ANTELOPDROP))],AMOUNTS1[Rnd.get(len(AMOUNTS1))]) 
206	  
207	QUEST       = Quest(144,qn,"Pailaka Injured Dragon") 
208	
209	QUEST.addStartNpc(KETRAOSHAMAN) 
210	QUEST.addTalkId(KETRAOSHAMAN) 
211	QUEST.addTalkId(KOSUPPORTER) 
212	QUEST.addTalkId(KOIO) 
213	QUEST.addTalkId(KOSUPPORTER2) 
214	QUEST.addKillId(18654) 
215	QUEST.addKillId(18649) 
216	QUEST.addKillId(LATANA) 
217	for i in Pailaka3rd: 
218	    QUEST.addKillId(i) 
219	for i in Antelopes: 
220	    QUEST.addKillId(i) 
221	

Insert into __init__.py

data

/

scripts

/

quests

/

144_PailakaInjuredDragon

/

__init__.py

 


 

I tested this code and fully working. but this is not my code  author Rost

 

Posted

Oh my God.

 

Put this "code" in quote/code block.

 

And remove line numbers.

 

And put proper [TAG], otherwise topic will be locked.

  • 5 weeks later...
  • 3 weeks later...
  • 4 weeks later...
Posted

Thanks for answer aya, but I'm having problem to do works it on my server (I use L2JServer too). Can you help me and explain how did you do?

 

Sorry if I'm so inconvenient but, I'm starting with java a few days and it's too hard somthings.

 

Thanks in advance...

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...