Jump to content
  • 0

[Help] Clan Reputation Trader


Question

Posted

Kalispera ... Exw ena problima me ton server mou . To problima einai oti exw ftiaksei enan clan reputation manager gia na perneis kapoia reputation points... otan anoigw ton server mou ola douleuoun entaksei xwris error alla otan pataw panw tou gia na parw ta clan reputation den deixnei tpt alla kai pali den bgazei kanena error ... Oriste o kwdikas

 

import sys

from com.l2jserver.gameserver.model.quest import State

from com.l2jserver.gameserver.model.quest import QuestState

from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest

from com.l2jserver.gameserver.network.serverpackets import PledgeShowInfoUpdate

 

qn = "8205_ClanPoints"

   

npcId          = 613

# Setup !!!

Soldier      = 7216

SoldierCount = 1000

Captain      = 7217

CaptainCount = 5000

General      = 7218

GeneralCount = 10000

# End Setup !!

QuestId      = 8205

QuestName    = "ClanPoints"

QuestDesc    = "custom"

InitialHtml  = "1.htm"

   

print "INFO Loaded: Clan Points AVOCADO !!!"

   

class Quest (JQuest) :

   

        def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

   

   

        def onEvent(self,event,st):

            htmltext = event

            count=st.getQuestItemsCount(Soldier)

            count1=st.getQuestItemsCount(Captain)

            count2=st.getQuestItemsCount(General)

            # first item

            if count == 0 and st.getPlayer().getClan == None and event == "2":

                htmltext = "Error1.html"

            elif count1 == 0 and st.getPlayer().getClan == None and event == "3":

                    htmltext = "Error2.html"

            elif count2 == 0 and st.getPlayer().getClan == None and event == "4":

                    htmltext = "Error3.html"

            else:

                st.getPlayer().setTarget(st.getPlayer())

                if event == "2":

                    if st.getPlayer().getClan() == None or st.getPlayer().getClan().getLeader() == 0:

                        return "You have to be a Clan Leader !!!!"

                    st.takeItems(Soldier, 1)

                    st.getPlayer().getClan().addReputationScore(SoldierCount,True)

                    st.playSound("ItemSound.quest_finish")

                    st.setState(State.COMPLETED)

                    st.exitQuest(1)

                    return "End.html"

                if htmltext != event:

                    st.setState(State.COMPLETED)

                    st.exitQuest(1)

                    return htmltext

            # 2 item

                st.getPlayer().setTarget(st.getPlayer())

                if event == "3":

                    if st.getPlayer().getClan() == None or st.getPlayer().getClan().getLeader() == 0:

                        return "You have to be a Clan Leader !!!!"

                    st.takeItems(Captain, 1)

                    st.getPlayer().getClan().addReputationScore(CaptainCount,True)

                    st.playSound("ItemSound.quest_finish")

                    st.setState(State.COMPLETED)

                    st.exitQuest(1)

                    return "End2.htm"

                if htmltext != event:

                    st.setState(State.COMPLETED)

                    st.exitQuest(1)

                    return htmltext

            # 3 ite

                st.getPlayer().setTarget(st.getPlayer())

                if event == "4":

                    if st.getPlayer().getClan() == None or st.getPlayer().getClan().getLeader() == 0:

                        return "You have to be a Clan Leader !!!!"

                    st.takeItems(General, 1)

                    st.getPlayer().getClan().addReputationScore(GeneralCount,True)

                    st.playSound("ItemSound.quest_finish")

                    st.setState(State.COMPLETED)

                    st.exitQuest(1)

                    return "End3.htm"

                if htmltext != event:

                    st.setState(State.COMPLETED)

                    st.exitQuest(1)

                    return htmltext

             

             

        def onTalk (self,npc,player):

          st = player.getQuestState(qn)

          htmltext = "<html><head><body>I have nothing to say to you</body></html>"

          st.setState(State.STARTED)

          return InitialHtml

         

QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)

QUEST.addStartNpc(npcId)

QUEST.addTalkId(npcId)

 

 

 

An mporei kapoios na me help :/

 

8 answers to this question

Recommended Posts

  • 0
Posted

oxi tipota den mou bgazei ... Exw kanei register to script kai den m bgazei kanena error .Apla otan pataw gia na m dwsei reputation points den douleuei ... Kamia idea?

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.

×
×
  • Create New...