Jump to content

Anti exp button


Recommended Posts

Hi, I have a problem I think is from the client-side.

Problem: When I click on the AntiExpRing and storage buttons it pops-up a this: 

xfpz5h.png

1orma9.jpg

 

Normally it dosen't suppous to pop-up nothing, just a text in the bottom-right that says whether or not the botton is activ or not.

I'll pot sa quest and the client part maybe someone knows a solutin.

 

Server-side:

 


 

  • quest clientquest_test begin
        state start begin
            when login begin
                cmdchat("loadquest1 "..q.getcurrentquestindex())
            end
            when button or info begin
                local get = clientquest_test.getinput("getinput")
    if get == "12" then -- Lager Button
    game.open_safebox()
    end
    
    
    if get == "13" then -- AntiExp Button
    if pc.getqf('reset2') == 0 then
    pc.setqf('reset2',1)
    pc.setqf('reset',pc.get_exp())
    loop_timer("antiexp", 1)
    syschat("Ati blocat experienta.")
    else
    pc.setqf('reset2',0)
    cleartimer("antiexp")
    syschat("Ati deblocat experienta.")
    end
    end
            end
    
    
    when login with pc.getqf('reset2') > 0 begin
    loop_timer("antiexp", 1)
    syschat("Experienta este blocata.")
    end
    
    
    when antiexp.timer begin
                local oxp = pc.getqf('reset')
                if pc.get_exp() > oxp then
                    pc.give_exp2(-(pc.get_exp()-oxp))
                end
            end
    
    
    function getinput(par)
                cmdchat("getinputbegin")
                local ret = input(cmdchat(par))
                cmdchat("getinputend")
                return ret
            end
        end
    end  

Client: 

constinfo.py


LoadQuest1 = 0
INPUT_IGNORE = 0
SendInfo = "0

game.py

 


def __QuestClient_1(self, qid):
constInfo.LoadQuest1 = qid


def __Inputget1(self):
constInfo.INPUT_IGNORE = 1 


def __Inputget2(self):
constInfo.INPUT_IGNORE = 0


def __Inputget3(self):
info = constInfo.SendInfo
net.SendQuestInputStringPacket(str(info))

# QUEST KOMMUNIKATION
"loadquest1" : self.__QuestClient_1,
"getinputbegin" : self.__Inputget1,
"getinputend" : self.__Inputget2,
"getinput" : self.__Inputget3,

uiinventory.py

 


def ClickIshopButton(self):
eq = constInfo.LoadQuest1
#chat.AppendChat(chat.CHAT_TYPE_INFO, eq)
constInfo.SendInfo = "12"
event.QuestButtonClick(int(eq))


def __AntiExpRing(self):
eq = constInfo.LoadQuest1
constInfo.SendInfo = "13"
event.QuestButtonClick(int(eq))

# MallButton
if self.mallButton:
self.mallButton.SetEvent(ui.__mem_func__(self.ClickMallButton))
self.ishopButton.SetEvent(ui.__mem_func__(self.ClickIshopButton))


self.AntiEXPButton.SetEvent(ui.__mem_func__(self.__AntiExpRing))

self.AntiEXPButton = self.GetChild2("AntiExpButton")
self.ishopButton = self.GetChild2("IshopButton")
self.ishopButton = None

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Developer

game.py

Search the following def:

	def OpenQuestWindow(self, skin, idx):
		self.interface.OpenQuestWindow(skin, idx)
And replace it with this:

	def OpenQuestWindow(self, skin, idx):
		if constInfo.INPUT_IGNORE == 1:
			return
		self.interface.OpenQuestWindow(skin, idx)
  • Love 2

when you return 0 and server doesn't boot:

unknown.png

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 24

      Experimental Renderer

    2. 11

      Multi Language System

    3. 0

      [FREE DESIGN] Interface + Logo + Discord Banner and Avatar

    4. 4

      Feeding game source to LLM

    5. 0

      Quest 6/7 Problem

    6. 5

      Effect weapons

    7. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.