Jump to content




  • 0

Adaptar Script


arthursergiop

Question

Bom dia, boa tarde e boa noite!

(a depender do período do dia que você veja o post)

Tenho tentado sem sucesso fazer com que este script que concede Donator Status enquanto o player estiver online passe a conceder por dias.

Visto que esse MOD vem de base em todas as Frozen, seria uma mão na roda para aqueles que não tem o MOD VIP em sua revisão e não sabe como compilar (assim como eu)

Agradeço desde já a ajuda.

Abaixo segue o Script, contém a autoria e foi retirado de um projeto do Onã aqui mesmo do fórum.

-------------------------------------------------------------------------------------------------------

 

#Created By Cheed!!!

import sys
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
from com.l2jfrozen.gameserver.model.actor.instance import L2NpcInstance
from java.util import Iterator
from com.l2jfrozen.util.database import L2DatabaseFactory
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen import Config
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2jfrozen.gameserver.datatables import SkillTable
from com.l2jfrozen.gameserver.network.serverpackets import SocialAction
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

qn = "50029_DonatorSeller"

NPC=[50029]

#ID Item
ITEM_ID=3436
#QTD Item
ITEM_QTD=1


QuestId     = 50029
QuestName   = "DonatorSeller"
QuestDesc   = "custom"
InitialHtml = "1.htm"

print "INFO  DonatorSeller==> ON"

class Quest (JQuest) :

 def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
 
 def onAdvEvent (self,event,npc,player) :
    htmltext = event
    st = player.getQuestState(qn)
    if not st: return

    def doDonator(player,days) :
     st.getPlayer().setDonator(True)
     st.player.broadcastPacket(SocialAction(st.player.getObjectId(),16))    

    
    if event == "1" :
     if st.getPlayer().isDonator():
      return "no.htm"
     else :
        if st.getQuestItemsCount(ITEM_ID) >= ITEM_QTD :
                  st.takeItems(ITEM_ID,ITEM_QTD)              
                  doDonator(st.player,1)                  
                  st.player.sendMessage("Parabens Voce ganhou Status Donator!")
                  return "1.htm"
        else:
         st.player.sendMessage("Voce Nao Tem Itens Suficiente!")
         return "1.htm"
        
    return htmltext        
    
 def onTalk (self,npc,player):
        htmltext = "<html><head><body>You can't buy while you are</body></html>"
        st = player.getQuestState(qn)
        if not st : return htmltext
        npcId = npc.getNpcId()        
        if st.player.getPvpFlag() > 0 :#Player Flag
            htmltext = "<html><head><body>You can't buy while you are <font color=\"800080\">flagged!</font><br>Wait some time and try again!</body></html>"
            st.exitQuest(1)
        elif st.player.getKarma() > 0 :#Player com Karma
            st.exitQuest(1)
            htmltext = "<html><head><body>You have too much <font color=\"FF0000\">karma!</font><br>Come back,<br>when you don't have any karma!</body></html>"
        elif st.player.isInCombat() :#Player modo de Combate
            st.exitQuest(1)
            htmltext = "<html><head><body>You can't buy while you are attacking!<br>Stop your fight and try again!</body></html>"
        else:
            
            return InitialHtml
        return htmltext

QUEST = Quest(50029,qn,"custom")
CREATED     = State('Start', QUEST)
STARTING    = State('Starting', QUEST)
STARTED     = State('Started', QUEST)
COMPLETED   = State('Completed', QUEST)
QUEST.setInitialState(CREATED)

for npcId in NPC:
 QUEST.addStartNpc(npcId)
 QUEST.addTalkId(npcId)

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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
Answer this question...

×   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.

Loading...
  • Join now

    Be part of the largest and oldest communities about Lineage2 in Latin America.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.