Jump to content

Need help making a quest "0% exp if item equipped"


Go to solution Solved by pewpew5,

Recommended Posts

Hello sorry to bother you guys again! But can yah help me with making a file.quest that checks if an emotion mask is equipped and if so block exp gain.

My first question is i have seen suggestions of pc.block_exp(), the input on the function is true = block and false = unblock?

my second question is how do i check if a certain item is equipped using the functions from the function list?

 

 

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Premium
On 9/5/2022 at 9:20 PM, pewpew5 said:

Hello sorry to bother you guys again! But can yah help me with making a file.quest that checks if an emotion mask is equipped and if so block exp gain.

My first question is i have seen suggestions of pc.block_exp(), the input on the function is true = block and false = unblock?

my second question is how do i check if a certain item is equipped using the functions from the function list?

 

 

 

Maybe this help:

####  Src/game/char.cpp

Spoiler
///in: 		case POINT_EXP:

//Search:
				[...]
				else
				{
					if (gPlayerMaxLevel <= GetLevel())
						return;

					if (test_server)
						ChatPacket(CHAT_TYPE_INFO, "You have gained %d exp.", amount);
                                                     
//Add after:
                    LPITEM pItem = GetWear(WEAR_WEAPON);
					if (NULL != pItem && pItem->GetVnum() == 10){
						return;
					}                                

 

 

 

 

 

 

 

 

if pc.get_sex() == true and npc.get_sex() == false then
	npc.purge()
end

 

Link to comment
Share on other sites

  • Solution

Ultimatly i was using the XXXX.use the wrong way.

the anti exp ring  code that works great is this

quest antiexpring begin
    state start begin
        when 40002.use with pc.getqf("antiexp") == 0 begin 
            local anti = pc.get_exp()
            pc.setqf("exp", anti)
            pc.setqf("antiexp", 1)
            timer("antiexptimer", 1)
            chat("Anti Exp Enabled")
        end
        when 40002.use with pc.getqf("antiexp") == 1 begin
            pc.setqf("antiexp", 0)
            chat("Anti Exp Disabled")
        end
        when kill with pc.getqf("antiexp") == 1 begin
            local exp = pc.get_exp()
            pc.give_exp2(-exp+pc.getqf("exp"))
        end
        when party_kill with pc.getqf("antiexp") == 1 begin
            local exp = pc.get_exp()
            pc.give_exp2(-exp+pc.getqf("exp"))
        end

        when antiexptimer.timer with pc.getqf("antiexp") == 1 begin
            local exp = pc.get_exp()
            pc.give_exp2(-exp+pc.getqf("exp"))
        end
    end
end

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



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