CraZy*™* Posted April 17, 2011 Posted April 17, 2011 hello, I have a question.... I have a NPC on my server , that you get clan Points and Clan lvl 8... But the problem is you can get only one time Clan points to one Clan. How I can make it , that you can get how much times you want Clan points`? Here is the _init_ 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.gameserver.model.quest.jython import QuestJython as JQuest qn = "6667_ClanManager" NPC=[66667] REQUESTED_ITEM=9883 REQUESTED_AMOUNT=2000 NEW_REP_SCORE=5000 QuestId = 6667 QuestName = "ClanManager" QuestDesc = "custom" InitialHtml = "66667-1.htm" print "Clan Manager (66667) Enabled..." class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onEvent(self,event,st): htmltext = "<html><head><body>I have nothing to say you</body></html>" count=st.getQuestItemsCount(REQUESTED_ITEM) if event == "66667-clanOk.htm" : if st.getPlayer().isClanLeader() and st.getPlayer().getClan().getLevel()<8: if st.getPlayer().isNoble() and count >= REQUESTED_AMOUNT: htmltext=event st.getPlayer().getClan().changeLevel(8) st.playSound("ItemSound.quest_finish") st.takeItems(REQUESTED_ITEM,REQUESTED_AMOUNT) else : htmltext="66667-no_clan.htm" st.exitQuest(1) else : htmltext="66667-no_clan.htm" st.exitQuest(1) elif event == "66667-repOk.htm" : if st.getPlayer().isClanLeader() and st.getPlayer().getClan().getLevel() >= 5 and st.getPlayer().getClan().getReputationScore() < NEW_REP_SCORE : if st.getPlayer().isNoble() and count > REQUESTED_AMOUNT: htmltext=event st.getPlayer().getClan().setReputationScore(NEW_REP_SCORE, 1); st.playSound("ItemSound.quest_finish") st.takeItems(REQUESTED_ITEM,REQUESTED_AMOUNT) else : htmltext="66667-no_points.htm" st.exitQuest(1) else : htmltext="66667-no_points.htm" st.exitQuest(1) return htmltext def onTalk (self,npc,player): htmltext = "<html><head><body>I have nothing to say you</body></html>" st = player.getQuestState(qn) if not st : return htmltext npcId = npc.getNpcId() id = st.getState() if id == CREATED : htmltext="66667-1.htm" elif id == COMPLETED : htmltext = "<html><head><body>This quest have already been completed.</body></html>" else : st.exitQuest(1) return htmltext QUEST = Quest(6667,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) I hope some one have better knewlege on scrips then Im, and can help me :) Thanks Quote
0 B1ggBoss Posted April 20, 2011 Posted April 20, 2011 In your script, when trying to add rep points, this is the first check it gotta pass before add points if st.getPlayer().isClanLeader() and st.getPlayer().getClan().getLevel() >= 5 and st.getPlayer().getClan().getReputationScore() < NEW_REP_SCORE : It checks that the clan is level 5 or below and your clan rep points are below 5000 points. Just erase the clan level and clan points check or just the points check, which is: and st.getPlayer().getClan().getReputationScore() < NEW_REP_SCORE Quote
0 CraZy*™* Posted April 20, 2011 Author Posted April 20, 2011 hmm maybe you not understand me... The problem is not the Clan lvl... , I mean ; If I do this one time .. I can't do it again. 1 Clan = 1x Clan Points but I want , 1 Clan = 99999999x Clan Point (how much you want) anyway I have try it with your code, but I can't make it more then 1x :/ Thanks, for your answer Quote
0 Matim Posted April 21, 2011 Posted April 21, 2011 Next time put your code in quote/code tag. Edited. Quote
Question
CraZy*™*
hello, I have a question.... I have a NPC on my server , that you get clan Points and Clan lvl 8...
But the problem is you can get only one time Clan points to one Clan.
How I can make it , that you can get how much times you want Clan points`?
Here is the _init_
I hope some one have better knewlege on scrips then Im, and can help me :) Thanks
4 answers to this question
Recommended Posts
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.