This commit is contained in:
		
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30839-1.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30839-1.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Trader Holly:<br> | ||||
| Did you find the<font color="LEVEL"> Imperial Genealogy</font>? I can give you some<font color="LEVEL"> Dark Crystal</font> recipes for the whole collection.<br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30839">"I'll give you the five pages of Genealogy"</a> | ||||
| </body></html> | ||||
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30839-2.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30839-2.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Trader Holly:<br> | ||||
| You actually found a copy of the Imperial Genealogy! Thank you, take this as a token of my gratitude.<br> | ||||
| Come back if you manage to get another complete copy, i could be more generous next time! | ||||
| </body></html> | ||||
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30839-3.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30839-3.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Trader Holly:<br> | ||||
| Oh, You didn't find a complete copy of the Imperial Genealogy! What a pity, I'm not interested on spare fragments.<br> | ||||
| Come back only if you manage to get a complete copy! | ||||
| </body></html> | ||||
							
								
								
									
										8
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-1.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-1.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| <html><body>Warehouse Keeper Walderal:<br> | ||||
| Did you find anything? Or perhaps you have a Question?<br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30844-8.htm">"Tell me more about the contract i signed"</a><br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30844-9.htm">"I have found many other things besides blueprints..."</a><br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30844">"I've brought you all the blueprints for 13 floors of the Tower of Insolence."</a><br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30844-10.htm">"I'll continue to look for more blueprints."</a><br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30844-7.htm">"I want out of the contract."</a> | ||||
| </body></html> | ||||
							
								
								
									
										3
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-10.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-10.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| <html><body>Warehouse Keeper Walderal:<br> | ||||
| Fine, Now please, get going. | ||||
| </body></html> | ||||
							
								
								
									
										5
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-11.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-11.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| <html><body>Warehouse Keeper Walderal:<br> | ||||
| You actually found the 13 blueprints! Thank you, take this as a token of my gratitude.<br> | ||||
| Come back if you manage to get another complete set of blueprints, i could be more generous next time!<br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30844-1.htm">Back</a> | ||||
| </body></html> | ||||
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-12.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-12.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Warehouse Keeper Walderal:<br> | ||||
| Oh, You didn't find all of the 13 Blueprints! What a pity, I'm not interested on spare blueprints but on the whole collection.<br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30844-1.htm">Back</a> | ||||
| </body></html> | ||||
							
								
								
									
										9
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-2.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-2.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| <html><body>Warehouse Keeper Walderal:<br> | ||||
| Ok, and assuming you really have all those 13 blueprints, what kind of recipe would you like to get?<br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence Wald_DarkCryst">Dark Crystal</a><br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence Wald_Tallum">Tallum</a><br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence Wald_Nightmare">Nightmare</a><br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence Wald_Majestic">Majestic</a><br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30844-7.htm">"Nevermind, I want to quit"</a><br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30844-1.htm">Back</a> | ||||
| </body></html> | ||||
							
								
								
									
										5
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-4.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-4.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| <html><body>Warehouse Keeper Walderal:<br> | ||||
| I'm looking for some experienced adventurer able to bring to me the blueprints of the Tower of Insolence to continue my reesarch. There are 13 of them and many other ancients relics could be found in the way.<br> | ||||
| Are you the one i were looking for?<br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30844-6.htm">"Yes, i am brave enough to help you"</a> | ||||
| </body></html> | ||||
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-5.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-5.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Warehouse Keeper Walderal:<br> | ||||
| I think it is too early for you to help me. Come back after you have gained some more experience.<br> | ||||
| <font color="LEVEL">(Quest for characters level 59 and above.)</font> | ||||
| </body></html> | ||||
							
								
								
									
										5
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-6.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-6.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| <html><body>Warehouse Keeper Walderal:<br> | ||||
| OK, Listen carefully. Bring to me the blueprints of the Tower of Insolence. There are 13 of them.<br> | ||||
| Take<font color="LEVEL"> Ancient Papyrs</font> from<font color="LEVEL"> Corrupt Sages, Erin Ediunces, Hallate's Inspectors, Platinum tribe Overlords, Platinum Guardian Prefects and Messenger Angels</font>. You must open those papyrs in order to see their contents. All i want are the blueprints...you can keep anything else you find on them.<br> | ||||
| Bring me all of them and I'll give you a recipe for a pair of gloves, shoes or a hat. Is that clear? Now, please, get going. | ||||
| </body></html> | ||||
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-7.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-7.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Warehouse Keeper Walderal:<br> | ||||
| It's too bad, but I guess it can't be helped. I have no choice but to look for another adventurer...<br> | ||||
| Well, I wish you happiness in your future. | ||||
| </body></html> | ||||
							
								
								
									
										6
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-8.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-8.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| <html><body>Warehouse Keeper Walderal:<br> | ||||
| Are you OK? How did you forget so quickly? OK, once more. Listen carefully. Bring to me the blueprints of the Tower of Insolence. There are 13 of them.<br> | ||||
| Take from<font color="LEVEL"> Corrupt Sages, Erin Ediunces, Hallate's Inspectors, Platinum tribe overlords, Platinum Guardian Prefects and Messenger Angels.</font> You can keep anything else you find on them. All i want are the blueprints...<br> | ||||
| Bring me all of them and I'll give you a recipe for a pair of gloves, shoes or a hat. Is that clear? Now, please, get going.<br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30844-1.htm">Back</a> | ||||
| </body></html> | ||||
							
								
								
									
										6
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-9.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30844-9.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| <html><body>Warehouse Keeper Walderal:<br> | ||||
| So, you've found another things?<br> | ||||
| Well, I know of some other people that could be interested in such findings.You should visit<font color="LEVEL"> Magister Desmond, Claudia Athebalt, Antique Dealer Patrin or Trader Holly.</font> All i want are the blueprints...<br> | ||||
| Bring me all of them and I'll give you a recipe for a pair of gloves, shoes or a hat. Is that clear? Now, please, get going.<br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30844-1.htm">Back</a> | ||||
| </body></html> | ||||
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30855-1.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30855-1.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Magister Desmond:<br> | ||||
| Did you find the<font color="LEVEL"> Revelations of the Seals</font>? I can give you some<font color="LEVEL"> Majestic</font> recipes for the whole collection.<br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30855">"I'll give you the seven Revelations"</a> | ||||
| </body></html> | ||||
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30855-2.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30855-2.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Magister Desmond:<br> | ||||
| You actually found a copy of the Revelations of the Seals! Thank you, take this as a token of my gratitude.<br> | ||||
| Come back if you manage to get another complete copy, i could be more generous next time! | ||||
| </body></html> | ||||
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30855-3.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30855-3.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Magister Desmond:<br> | ||||
| Oh, You didn't find a complete copy of the Revelations of the Seals! What a pity, I'm not interested on spare fragments.<br> | ||||
| Come back only if you manage to get a complete copy! | ||||
| </body></html> | ||||
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30929-1.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30929-1.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Antique Dealer Patrin:<br> | ||||
| Did you find the<font color="LEVEL"> Ancient Epics</font>? I can give you some<font color="LEVEL"> Tallum</font> recipes for the whole collection.<br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 30929">"I'll give you the five Ancient Epics"</a> | ||||
| </body></html> | ||||
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30929-2.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30929-2.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Antique Dealer Patrin:<br> | ||||
| You actually found a copy of the Ancient Epics! Thank you, take this as a token of my gratitude.<br> | ||||
| Come back if you manage to get another complete copy, i could be more generous next time! | ||||
| </body></html> | ||||
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30929-3.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/30929-3.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Antique Dealer Patrin:<br> | ||||
| Oh, You didn't find a complete copy of the Ancient Epics! What a pity, I'm not interested on spare fragments.<br> | ||||
| Come back only if you manage to get a complete copy! | ||||
| </body></html> | ||||
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/31001-1.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/31001-1.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Claudia Athebalt:<br> | ||||
| Did you find the<font color="LEVEL"> Revelations of the Seals</font>? I can give you some<font color="LEVEL"> Nightmare</font> recipes for the whole collection.<br> | ||||
| <a action="bypass -h Quest 372_LegacyOfInsolence 31001">"I'll give you the seven Revelations"</a> | ||||
| </body></html> | ||||
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/31001-2.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/31001-2.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Claudia Athebalt:<br> | ||||
| You actually found a copy of the Revelations of the Seals! Thank you, take this as a token of my gratitude.<br> | ||||
| Come back if you manage to get another complete copy, i could be more generous next time! | ||||
| </body></html> | ||||
							
								
								
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/31001-3.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/31001-3.htm
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| <html><body>Claudia Athebalt:<br> | ||||
| Oh, You didn't find a complete copy of the Revelations of the Seals! What a pity, I'm not interested on spare fragments.<br> | ||||
| Come back only if you manage to get a complete copy! | ||||
| </body></html> | ||||
							
								
								
									
										180
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/__init__.py
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										180
									
								
								trunk/dist/game/data/scripts/quests/372_LegacyOfInsolence/__init__.py
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,180 @@ | ||||
| # Legacy of Insolence version 0.1 | ||||
| # by DrLecter | ||||
| import sys | ||||
| from com.l2jserver import Config | ||||
| from com.l2jserver.gameserver.model.quest import State | ||||
| from com.l2jserver.gameserver.model.quest import QuestState | ||||
| from com.l2jserver.gameserver.model.quest import Quest as JQuest | ||||
|  | ||||
| qn = "372_LegacyOfInsolence" | ||||
|  | ||||
| # 1- Variables: Maybe you would like to change something here: | ||||
| # If a non-zero value is set here, recipes will be 100% instead of 60% | ||||
| # (default setting matches retail rewards) | ||||
| ALT_RP_100=0 | ||||
| # Cummulative chances to get: [ "3 recipes", "4000 adena", "2 recipes", max_chance] | ||||
| # Default is: 1%,2%,2% (read give_reward method downwards if something isn't clear) | ||||
| # In order to make special rewards harder to get, you could set max_chance to 1000, or slt | ||||
| REWARD_RATE = [1,3,5,100] | ||||
| # 2- Quest info: You prolly won't need to change this | ||||
| QUEST_NUMBER,QUEST_NAME,QUEST_DESCRIPTION = 372, "LegacyOfInsolence", "Legacy of Insolence" | ||||
| # 3- Quest specific definitions: Don't mess with it unless you know what you're doing | ||||
| #Quest items: Papyrus | ||||
| RE_PAP,BL_PAP,BK_PAP,WH_PAP=range(5966,5970) | ||||
| # Collectibles: | ||||
| COLLECTION = { | ||||
| "Rev":range(5972,5979), #Revelations of the Seals | ||||
| "Anc":range(5979,5984), #Ancient Epics | ||||
| "Imp":range(5984,5989), #Imperial Genealogy | ||||
| "ToI":range(5989,6002)  #ToI Blueprints | ||||
| } | ||||
| #name:[boots,gloves,helm], | ||||
| REWARD={ | ||||
| "DarkCryst":[5525,5508,5496], | ||||
| "Tallum":   [5526,5509,5497], | ||||
| "Nightmare":[5527,5514,5502], | ||||
| "Majestic": [5528,5515,5503], | ||||
| "Wald_DarkCryst":[5368,5392,5426,5525,5508,5496], # Walderal includes recipes | ||||
| "Wald_Tallum":   [5370,5394,5428,5526,5509,5497], # Walderal includes recipes | ||||
| "Wald_Nightmare":[5380,5404,5430,5527,5514,5502], # Walderal includes recipes | ||||
| "Wald_Majestic": [5382,5406,5432,5528,5515,5503], # Walderal includes recipes | ||||
| } | ||||
| #Recipes for 100% option | ||||
| RECIPES=[5368,5392,5426,5370,5394,5428,5380,5404,5430,5382,5406,5432] | ||||
| #NPCs Area | ||||
| WALDERAL,DESMOND,CLAUDIA,PATRIN,HOLLY=30844,30855,31001,30929,30839 | ||||
| #Npc: ("Needed Collectibles","Reward recipes") | ||||
| NPC = { | ||||
| WALDERAL: ("ToI"),            #Well, this guy is special | ||||
| DESMOND:  ("Rev","Majestic"), | ||||
| CLAUDIA:  ("Rev","Nightmare"), | ||||
| PATRIN:   ("Anc","Tallum"), | ||||
| HOLLY:    ("Imp","DarkCryst") | ||||
| } | ||||
| #Mobs & Drop | ||||
| CORRUPT_SAGE,ERIN_EDIUNCE,HALLATE_INSP,PLATINUM_OVL,PLATINUM_PRE,MESSENGER_A1,MESSENGER_A2=20817,20821,20825,20829,21069,21062,21063 | ||||
| # This drop distribution should match retail. | ||||
| MOB = { | ||||
| CORRUPT_SAGE:[RE_PAP,35], | ||||
| ERIN_EDIUNCE:[RE_PAP,40], | ||||
| HALLATE_INSP:[RE_PAP,45], | ||||
| PLATINUM_OVL:[BL_PAP,40], | ||||
| PLATINUM_PRE:[BK_PAP,25], | ||||
| MESSENGER_A1:[WH_PAP,25], | ||||
| MESSENGER_A2:[WH_PAP,25] | ||||
| } | ||||
| #Helpers | ||||
| def check_n_take(st,collection) : | ||||
|     result = False | ||||
|     coll2check = COLLECTION[collection] | ||||
|     dec = 2**len(coll2check) | ||||
|     for i in range(len(coll2check)) : | ||||
|       if st.getQuestItemsCount(coll2check[i]) > 0 : | ||||
|          dec = dec >> 1 | ||||
|     if dec == 1 : | ||||
|        for k in range(len(coll2check)) : | ||||
|          st.takeItems(coll2check[k], 1)  | ||||
|        result = True | ||||
|     return result | ||||
|  | ||||
| def give_reward(st,reward) : | ||||
|     luck = st.getQuest().getRandom(REWARD_RATE[-1]) | ||||
|     prize = REWARD[reward] | ||||
|     if ALT_RP_100 != 0 : | ||||
|        for i in range(len(prize)) : | ||||
|            if prize[i] in RECIPES:        # dont want to change keys materials, just recipes | ||||
|              prize[i]+=1 | ||||
|     if luck < REWARD_RATE[0] :            # best reward: all items from collection | ||||
|        for j in prize : | ||||
|            st.giveItems(j,1) | ||||
|     elif luck < REWARD_RATE[1] :          # worst reward: 4000a | ||||
|        st.giveItems(57,4000) | ||||
|     elif luck < REWARD_RATE[2] :          # quite nice : 2 recipes | ||||
|        for k in range(2) : | ||||
|           l = st.getQuest().getRandom(len(prize)) | ||||
|           st.giveItems(prize[l],1) | ||||
|           del prize[l] | ||||
|     else :                                # ordinary reward: 1 recipe or mat | ||||
|        st.giveItems(prize[st.getQuest().getRandom(len(prize))],1) | ||||
|  | ||||
|  | ||||
| class Quest (JQuest) : | ||||
|  | ||||
|  def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) | ||||
|  | ||||
|  def onEvent (self,event,st) : | ||||
|     id = st.getState()  | ||||
|     htmltext = event | ||||
|     if event == "30844-6.htm": | ||||
|        st.set("cond","1") | ||||
|        st.setState(State.STARTED) | ||||
|        st.playSound("ItemSound.quest_accept") | ||||
|     elif event == "30844-7.htm" : | ||||
|        st.playSound("ItemSound.quest_finish") | ||||
|        st.exitQuest(1) | ||||
|     elif event == "30844-9.htm" : | ||||
|        st.set("cond","2")  | ||||
|     elif len(event) == 5 and int(event) in NPC.keys() : | ||||
|        if event == "30844" : | ||||
|           htmltext = "30844-2.htm" | ||||
|        else : | ||||
|           if check_n_take(st,NPC[int(event)][0]) : | ||||
|              give_reward(st,NPC[int(event)][1]) | ||||
|              htmltext = event+"-2.htm" | ||||
|           else : | ||||
|              htmltext = event+"-3.htm" | ||||
|     elif event in REWARD.keys() : | ||||
|        if check_n_take(st,"ToI") : | ||||
|           give_reward(st,event) | ||||
|           htmltext = "30844-11.htm" | ||||
|        else : | ||||
|           htmltext = "30844-12.htm" | ||||
|     return htmltext | ||||
|  | ||||
|  def onTalk (self,npc,player): | ||||
|    htmltext = Quest.getNoQuestMsg(player) | ||||
|    st = self.getQuestState(player, True) | ||||
|    if not st : return htmltext | ||||
|  | ||||
|    npcId = npc.getId() | ||||
|    id = st.getState() | ||||
|    if npcId != WALDERAL and id != State.STARTED : return htmltext | ||||
|  | ||||
|    if id == State.CREATED : | ||||
|       st.set("cond","0") | ||||
|       htmltext = "30844-4.htm" | ||||
|       if player.getLevel() < 59 : | ||||
|          st.exitQuest(1) | ||||
|          htmltext = "30844-5.htm" | ||||
|    elif id == State.STARTED : | ||||
|       htmltext = str(npcId)+"-1.htm" | ||||
|    return htmltext | ||||
|  | ||||
|  def onKill(self,npc,player,isPet) : | ||||
|      partyMember = self.getRandomPartyMemberState(player,State.STARTED) | ||||
|      if not partyMember : return | ||||
|      st = partyMember.getQuestState(qn) | ||||
|       | ||||
|      npcId = npc.getId() | ||||
|      item,chance=MOB[npcId] | ||||
|      chance*=Config.RATE_QUEST_DROP | ||||
|      chance = int(chance) | ||||
|      numItems,chance = divmod(chance,100) | ||||
|      if self.getRandom(100) < chance : | ||||
|          numItems = numItems + 1 | ||||
|      if numItems : | ||||
|         st.giveItems(item,numItems) | ||||
|         st.playSound("ItemSound.quest_itemget") | ||||
|      return | ||||
|  | ||||
| # Quest class and state definition | ||||
| QUEST       = Quest(QUEST_NUMBER, str(QUEST_NUMBER)+"_"+QUEST_NAME, QUEST_DESCRIPTION) | ||||
|  | ||||
|  | ||||
| QUEST.addStartNpc(WALDERAL) | ||||
|  | ||||
| for i in NPC.keys() : | ||||
|   QUEST.addTalkId(i) | ||||
|  | ||||
| for i in MOB.keys() : | ||||
|   QUEST.addKillId(i) | ||||
		Reference in New Issue
	
	Block a user
	 mobius
					mobius