# custom 1006: tattoos
# Custom friendly version by DrLecter
# 2005.09.11
# Settings
NPC = [7729]
QuestId = 1006
QuestName = "tattoos"
QuestDesc = "custom"
InitialHtml = "1.htm"
# Items [name, itemId, takeItemId, takeItemQty, TattooProperties]
Items = [
["Tattoo of Power", 485, 1458, 181,["pAtk:+5%"]],
["Tattoo of Fire", 486, 1458, 276,["mAtk:+5%","mAtkSpeed:+5%"]],
["Tattoo of Resolve", 487, 1458, 276,["pAtk:+5%","pAtkSpeed:+5%"]],
["Tattoo of Flame", 488, 1459, 428,["mAtk:+10%","max MP:+1000"]],
["Tattoo of Bravery", 489, 1459, 428,["pAtk:+10%","max HP:+1000"]],
["Tattoo of Blood", 490, 1461, 277,["pAtkSpeed:+15%","mAtkSpeed:+15%","Bleed Resist:+10%"]],
["Tattoo of Absolute", 491, 1461, 422,["max HP:+1250","pAtk:+20%","Reflect Dmg:+25%"]],
["Tattoo of Soul", 492, 1458, 181,["mAtk:+5%"]],
["Tattoo of Avadon", 493, 1460, 208,["pAtk:+10%","pAtkSpeed:+10%"]],
["Tattoo of Doom", 494, 1460, 321,["pAtk:+10%","root Resist:+10%","sleep Resist:+10%","stun Resist:+10%"]],
["Tattoo of Pledge", 495, 1460, 208,["mAtk:+10%","mAtkSpeed:+10%"]],
["Tattoo of Divine", 496, 1460, 321,["mAtk:+10%","root Resist:+10%","sleep Resist:+10%","stun Resist:+10%"]],
["Tattoo of Nightmare", 2410, 1461, 422,["putaque pariumax MP:+1250","mAtk:+20%","Reflect Dmg:+25%"]],
]
# ---------------------------------------------------------------------------
# DO NOT MODIFY BELOW THIS LINE
# ---------------------------------------------------------------------------
print "importing " + QuestDesc + ": " + str(QuestId) + ": " + QuestName + ": " + str(len(Items)) + " item(s)",
import sys
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
def do_RequestedEvent(item, st, takenId, takenQty) :
if st.getQuestItemsCount(takenId) >= takenQty :
st.takeItems(takenId, takenQty)
st.giveItems(int(item), 1)
return "Enjoy your new tattoo"
else :
return "You do not have enough crystals."
def show_RequestedEvent(name,item,takenId,takenQty,props) :
if takenId==1458: crystal="D Crystals";color='blue'
elif takenId==1459: crystal="C Crystals";color='green'
elif takenId==1460: crystal="B Crystals";color='red'
elif takenId==1461: crystal="A Crystals";color='silver'
line1='
Item Information
| '
line2=' |
'+name+' |
'
for prop in props:
keyvalue= prop.split(":")
line2=line2+'| '+str(keyvalue[0])+':'+str(keyvalue[1])+' |
'
line3='
| Crystals required |
'
line4=' '+crystal+' | | X '+str(takenQty)+' |
|
'
line5='
'
return line1+line2+line3+line4+line5+line6+line7
### main code
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent (self,event,st) :
htmltext = event
if event == "0":
return InitialHtml
for item in Items:
if event == str(item[1])+".htm":
htmltext = show_RequestedEvent(item[0],item[1],item[2], item[3], item[4])
elif event == str(item[1]):
htmltext = do_RequestedEvent(event, st, item[2], item[3])
return htmltext
def onTalk (Self,npcId,st):
htmltext = "I have nothing to say with you"
id = st.getState()
if id == CREATED :
st.setState(COMPLETED)
st.exitQuest(1)
return InitialHtml
### Quest class and state definition
QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)
CREATED = State('Start', QUEST)
STARTED = State('Started', QUEST)
COMPLETED = State('Completed', QUEST)
### Quest initialization
QUEST.setInitialState(CREATED)
for item in NPC:
### Quest NPC starter initialization
QUEST.addStartNpc(item)
### Quest NPC initialization
STARTED.addTalkId(item)
print "...done"