#Made by Emperorc
import sys
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
from com.l2jserver.util import Rnd
from com.l2jserver.gameserver.network.serverpackets import NpcSay
qn = "335_TheSongOfTheHunter"
#NPCS
Grey = 30744
Tor = 30745
Cybellin = 30746
#Items
Cyb_Dagger = 3471
License_1 = 3692
License_2 = 3693
Leaf_Pin = 3694
Test_Instructions_1 = 3695
Test_Instructions_2 = 3696
Cyb_Req = 3697
#Mobs
Breka_Orc_Warrior = 20271
Windsus = 20553
Tarlk_Bugbear_Warrior = 20571
Gremlin_Filcher = 27149
Mobs = [Breka_Orc_Warrior, Windsus, Tarlk_Bugbear_Warrior, Gremlin_Filcher]
Lizardmen = [20578,20579,20581,20582,20641,20642,20643]
#Droplist Format- npcId:[itemId,itemAmount,chance]
Level_1 = {
20550 : [3709,40,75], #Gaurdian Basilisk
20581 : [3710,20,50], #Leto Lizardman Shaman
27140 : [3711,1,100], #Breka Overlord Haka
27141 : [3712,1,100], #Breka Overlord Jaka
27142 : [3713,1,100], #Breka Overlord Marka
27143 : [3714,1,100], #Windsus Aleph
20563 : [3715,20,50], #Manashen Gargoyle
20565 : [3715,20,50], #Enchanted Stone Golemn
20555 : [3716,30,70], #Giant Fungus
}
Level_2 = {
20586 : [3717,20,50], #Timak Orc Warrior
20560 : [3718,20,50], #Trisalim Spider
20561 : [3718,20,50], #Trisalim Tarantula
20591 : [3719,30,100], #Valley Treant
20597 : [3719,30,100], #Valley Treant Elder
20675 : [3720,20,50], #Tairim
20660 : [3721,20,50], #Archer of Greed
27144 : [3722,1,100], #Tarlk Raider Athu
27145 : [3723,1,100], #Tarlk Raider Lanka
27146 : [3724,1,100], #Tarlk Raider Triska
27147 : [3725,1,100], #Tarlk Raider Motura
27148 : [3726,1,100], #Tarlk Raider Kalath
}
Grey_Advance = [
#level 1
[[3709],40],
[[3710],20],
[[3711,3712,3713],1],
[[3714],1],
[[3715],20],
[[3716],30],
#level 2
[[3717],20],
[[3718],20],
[[3719],30],
[[3720],20],
[[3721],20],
[[3722,3723,3724,3725,3726],1]
]
#Droplist Format- npcId : [itemRequired,itemGive,itemToGiveAmount,itemAmount,chance]
Tor_requests_1 = {
20578 : [3727,3769,'1',40,80], #Leto Lizardman Archer
20579 : [3727,3769,'1',40,83], #Leto Lizardman Soldier
20586 : [3728,3770,'1',50,89], #Timak Orc Warrior
20588 : [3728,3770,'1',50,100], #Timak Orc Overlord
20565 : [3729,3771,'1',50,100], #Enchanted Stone Golem
20556 : [3730,3772,'1',30,50], #Giant Monster Eye
20557 : [3731,3773,'1',40,80], #Dire Wyrm
20550 : [3732,3774,'Rnd.get(2) + 1',100,100], #Guardian Basilisk
20552 : [3733,3775,'1',50,100], #Fettered Soul
20553 : [3734,3776,'1',30,50], #Windsus
20554 : [3735,3777,'2',100,100],#Grandis
20631 : [3736,3778,'1',50,100], #Taik Orc Archer
20632 : [3736,3778,'1',50,93], #Taik Orc Warrior
20600 : [3737,3779,'1',30,50], #Karul Bugbear
20601 : [3738,3780,'1',40,62], #Tamlin Orc
20602 : [3738,3780,'1',40,80], #Tamlin Orc Archer
27157 : [3739,3781,'1',1,100], #Leto Chief Narak
20567 : [3740,3782,'1',50,50], #Enchanted Gargoyle
20269 : [3741,3783,'1',50,93], #Breka Orc Shaman
20271 : [3741,3783,'1',50,100], #Breka Orc Warrior
27156 : [3742,3784,'1',1,100], #Leto Shaman Ketz
27158 : [3743,3785,'1',1,100], #Timak Raider Kaikee
20603 : [3744,3786,'1',30,50], #Kronbe Spider
27160 : [3746,3788,'1',1,100], #Gok Magok
27164 : [3747,3789,'1',1,100] #Karul Chief Orooto
}
#Droplist Format- npcId : [itemRequired,itemGive,itemAmount,chance]
Tor_requests_2 = {
20560 : [3749,3791,40,66], #Trisalim Spider
20561 : [3749,3791,40,75], #Trisalim Tarantula
20633 : [3750,3792,50,53], #Taik Orc Shaman
20634 : [3750,3792,50,99], #Taik Orc Captain
20641 : [3751,3793,40,88], #Harit Lizardman Grunt
20642 : [3751,3793,40,88], #Harit Lizardman Archer
20643 : [3751,3793,40,91], #Harit Lizardman Warrior
20661 : [3752,3794,20,50], #Hatar Ratman Thief
20662 : [3752,3794,20,52], #Hatar Ratman Boss
20667 : [3753,3795,30,90], #Farcran
20589 : [3754,3796,40,49], #Fline
20590 : [3755,3797,40,51], #Liele
20592 : [3756,3798,40,80], #Satyr
20598 : [3756,3798,40,100], #Satyr Elder
20682 : [3758,3800,30,70], #Vanor Silenos Grunt
20683 : [3758,3800,30,85], #Vanor Silenos Scout
20684 : [3758,3800,30,90], #Vanor Silenos Warrior
20571 : [3759,3801,30,63], #Tarlk Bugbear Warrior
27159 : [3760,3802,1,100], #Timak Overlord Okun
27161 : [3761,3803,1,100], #Taik Overlord Kakran
20639 : [3762,3804,40,86], #Mirror
20664 : [3763,3805,20,77], #Deprive
20593 : [3764,3806,20,68], #Unicorn
20599 : [3764,3806,20,86], #Unicorn Elder
27163 : [3765,3807,1,100], #Vanor Elder Kerunos
20659 : [3766,3808,20,73], #Grave Wanderer
27162 : [3767,3809,1,100], #Hatar Chieftain Kubel
20676 : [3768,3810,10,64] #Judge of Marsh
}
#FilcherDropList Format- reqId : [item,amount,bonus]
Filcher = {
3752 : [3794,20,3],
3754 : [3796,40,5],
3755 : [3797,40,5],
3762 : [3804,40,5]
}
#SpawnList Format- npcId : [item1,item2,npcToSpawn]
Tor_requests_tospawn = {
20582 : [3739,3781,27157], #Leto Lizardman Overlord
20581 : [3742,3784,27156], #Leto Lizardman Shaman
20586 : [3743,3785,27158], #Timak Orc Warrior
20554 : [3746,3788,27160], #Grandis
#level 2
20588 : [3760,3802,27159], #Timak Orc Overlord
20634 : [3761,3803,27161], #Tiak Orc Captain
20686 : [3765,3807,27163], #Vanor Silenos Chieftan
20662 : [3767,3809,27162] #Hatar Ratman Boss
}
#RewardsList Format- requestId : [item,quantity,rewardAmount]
Tor_Rewards_1 = {
3727 : [3769,40,2090],
3728 : [3770,50,6340],
3729 : [3771,50,9480],
3730 : [3772,30,9110],
3731 : [3773,40,8690],
3732 : [3774,100,9480],
3733 : [3775,50,11280],
3734 : [3776,30,9640],
3735 : [3777,100,9180],
3736 : [3778,50,5160],
3737 : [3779,30,3140],
3738 : [3780,40,3160],
3739 : [3781,1,6370],
3740 : [3782,50,19080],
3741 : [3783,50,17730],
3742 : [3784,1,5790],
3743 : [3785,1,8560],
3744 : [3786,30,8320],
3746 : [3788,1,27540],
3747 : [3789,1,20560],
}
Tor_Rewards_2 = {
3749 : [3791,40,7250],
3750 : [3792,50,7160],
3751 : [3793,40,6580],
3752 : [3794,20,10100],
3753 : [3795,30,13000],
3754 : [3796,40,7660],
3755 : [3797,40,7660],
3756 : [3798,40,11260],
3758 : [3800,30,8810],
3759 : [3801,30,7350],
3760 : [3802,1,8760],
3761 : [3803,1,9380],
3762 : [3804,40,17820],
3763 : [3805,20,17540],
3764 : [3806,20,14160],
3765 : [3807,1,15960],
3766 : [3808,20,39100],
3767 : [3809,1,39550],
3768 : [3810,10,41200]
}
#Format item : adenaAmount
Cyb_Rewards = {
3699 : 3400,
3700 : 6800,
3701 : 13600,
3702 : 27200,
3703 : 54400,
3704 : 108800,
3705 : 217600,
3706 : 435200,
3707 : 870400
}
Tor_menu = [
"C: Obtain 40 charms of Kadesh
",
"C: Collect 50 Timak Jade Necklaces
",
"C: Gather 50 Enchanted Golem Shards
",
"C: Collect and bring back 30 pieces of Giant Monster Eye Meat
",
"C: Collect and bring back 40 Dire Wyrm Eggs
",
"C: Collect and bring back 100 guardian basilisk talons
",
"C: Collect and bring back 50 revenants chains
",
"C: Collect and bring back 30 Windsus Tusks
",
"C: Collect and bring back 100 Grandis Skulls
",
"C: Collect and bring back 50 Taik Obsidian Amulets
",
"C: Bring me 30 heads of karul bugbears
",
"C: Collect 40 Tamlin Ivory Charms
",
"B: Bring me the head of Elder Narak of the leto lizardmen
",
"B: Collect and bring back 50 Enchanted Gargoyle Horns
",
"B: Collect and bring back 50 Coiled Serpent Totems
",
"B: Bring me the totem of the Serpent Demon Kadesh
",
"B: Bring me the head of Kaikis
",
"B: Collect and bring back 30 Kronbe Venom Sacs
",
"A: Recover the precious stone tablet that was stolen from a Dwarven cargo wagon by grandis
",
"A: Recover the precious Book of Shunaiman
",
"C: Collect and bring back 40 Trisalim Venom Sacs
",
"C: Collect and bring back 50 Taik Orc Totems
",
"C: Collect and bring back 40 Harit Lizardman barbed necklaces
",
"C: Collect and bring back 20 coins of the old empire
",
"C: Kill 30 farcrans and bring back their skins
",
"C: Collect and bring back 40 Tempest Shards
",
"C: Collect and bring back 40 Tsunami Shards
",
"C: Collect and bring back 40 Satyr Manes
",
"C: Collect and bring back 30 Shillien Manes
",
"C: Collect and bring back 30 tarlk bugbear totems
",
"B: Bring me the head of Okun
",
"B: Bring me the head of Kakran
",
"B: Collect and bring back 40 narcissus soulstones
",
"B: Collect and bring back 20 Deprive Eyes
",
"B: Collect and bring back 20 horns of summon unicorn
",
"B: Bring me the golden mane of Kerunos
",
"A: Bring back 20 skulls of undead executed criminals
",
"A: Recover the stolen bust of the late King Travis
",
"A: Recover 10 swords of Cadmus
"
]
def HasItems(st,check) :
count = 0
for list in Grey_Advance :
count2 = 0
for item in list[0] :
if not st.getQuestItemsCount(item) >= list[1] :
break
count2 += 1
if count2 == len(list[0]) :
count += 1
if count >= check :
return 1
return 0
def AutoChat(npc,text) :
chars = npc.getKnownList().getKnownPlayers().values().toArray()
if chars != None:
for pc in chars :
sm = NpcSay(npc.getObjectId(), 0, npc.getId(), text)
pc.sendPacket(sm)
def HasRequestCompleted(st,level) :
rewards = Tor_Rewards_1
if level == 2 :
rewards = Tor_Rewards_2
for req in rewards.keys() :
if st.getQuestItemsCount(req) :
if st.getQuestItemsCount(rewards[req][0]) >= rewards[req][1] :
return req
return 0
class Quest (JQuest) :
def __init__(self,id,name,descr):
JQuest.__init__(self,id,name,descr)
self.questItemIds = range(3692,3811) + [3471]
def onAdvEvent (self,event,npc,player):
st = self.getQuestState(player, False)
if not st: return
htmltext = event
if event == "30744-03.htm" :
st.setState(State.STARTED)
st.playSound("ItemSound.quest_accept")
st.giveItems(Test_Instructions_1,1)
st.set("cond","1")
#set Memo = 0
elif event == "30744-32.htm" :
st.playSound("ItemSound.quest_finish")
if st.getQuestItemsCount(Leaf_Pin) >= 20 :
htmltext = "30744-33.htm"
st.giveItems(57,20000)
st.exitQuest(1)
elif event == "30744-19.htm" :
if not HasItems(st,1) :
st.giveItems(Test_Instructions_2,1)
htmltext = "30744-18.htm"
elif event == "30745-03.htm" :
if st.getQuestItemsCount(Test_Instructions_2) :
htmltext = "30745-04.htm"
elif event == "Tor_list_1" :
if not st.getInt("hasTask") :
htmltext = "