Hi all!
I followed the guide at that link about the connection between client and quest:
[Hidden Content]
But when I press the button in game, nothing happens in the quest! If I do it only on a graphical point of view, the button reacts to the click, but it doesn't get the anti exp active.
This is my code added for the quest:
game.py:
def OnClickBlockExp(self):
event.QuestButtonClick(int(constInfo.BLOCK_EXP))
----------------------------------------------------------------------------------------------------------------
def __ServerCommand_Build(self):
serverCommandList={
"blocco_exp" : self.blocco_exp,
----------------------------------------------------------------------------------------------------------------
def blocco_exp(self,value):
constInfo.BLOCK_EXP = int(value)
quest:
quest anti_exp begin
state start begin
when login begin
cmdchat("blocco_exp "..q.getcurrentquestindex())
if pc.getqf("blocco_exp") == 1 then
pc.setqf("exp_pc",pc.get_exp())
chat("[Blocco Esperienza] - Attivato!")
elseif pc.getqf("blocco_exp") == 0 then
chat("[Blocco Esperienza] - Disattivato!")
end
end
when button or info begin
if pc.getqf("blocco_exp") == 0 then
pc.setqf("blocco_exp", 1)
pc.setqf("exp_pc",pc.get_exp())
chat("[Blocco Esperienza] - Attivato!")
elseif pc.getqf("blocco_exp") == 1 then
pc.setqf("blocco_exp", 0)
chat("[Blocco Esperienza] - Disattivato!")
end
end
when kill with not npc.is_pc() begin
if pc.getqf("blocco_exp") == 1 then
pc.give_exp2(pc.getqf("exp_pc")-pc.get_exp())
end
end
end
end
Could someone tell me why it doesn't work please?