Jump to content
Sign in to follow this  
Shogun

Anti Exp Ring and Voodoo Armband

Recommended Posts

Today I release two small quests made by me a long time ago.

 

 

Goddess Doll

 

The first is an anti-experience ring that prevents you from gaining exp from mobs when used. Using it again disables the effect. Be aware that the quest substracts the gained exp after it has been received so if the exp from a mob is enough to reach the next level, you will level up!

quest exp_curse begin
	state start begin
		when 70210.use begin
			pc.setqf("lastexp",pc.get_exp())
			syschat("You are under the curse of the goddess. You will gain no experience.")
			set_state(use)
		end
	end
	
	state use begin
		when 70210.use begin
			syschat("You lifted the curse of the goddess. You gain experience again.")
			set_state(start)
		end
		
		when login begin
			syschat("You are currently under the curse of the goddess and gain no experience.")
		end
		
		when kill or party_kill begin
			local current = pc.get_exp()
			local doll = pc.count_item(70210)
			if doll == 0 then
				syschat("The curse of the Goddess has lifted. You will gain Experience again.")
				set_state(start)
			end
			if current < pc.getqf("lastexp") then
				pc.setqf("lastexp",current)
			end
			if not npc.is_pc() then
				local dif = pc.get_exp()-pc.getqf("lastexp")
				pc.give_exp2(-dif)
			end
		end
	end
end

Voodoo Armband

 

The Voodoo Armband is a fun item which lets you convert players into an ugly creature for a few minutes.

quest polyplayer begin
	state start begin
		when 70111.use begin
			local start_count = pc.count_item(item.get_vnum()) -- to prevent usage of bugs only
			say_title("Voodoo Armband:")
			say("")
			say("Enter the name of the player you want to curse:")
			say("")
			local name = input()
			local vid = find_pc_by_name(name)
			if name == "" then
				return
			elseif name == pc.get_name() then
				say_title("Ring of Curse:")
				say("")
				say("You can not curse yourself.")
				say("")
				return
			elseif vid == 0 then
				say_title("Ring of Curse:")
				say("")
				say("This player is not online or does not exist.")
				say("")
				return
			elseif not pc.is_near_vid(vid, 50) then
				say_title("Ring of Curse:")
				say("")
				say("The player is too far away.")
				say("")
				return
			end
			
			if pc.count_item(item.get_vnum()) != start_count then
				return
			end
			
			local myvid = pc.select(vid)
			vnums = {2101, 20016, 20002, 11000, 5001, 992, 1301, 1303, 2191, 5161, 5162, 5163}
			i = number(1,12)
			pc.polymorph(vnums[i], 5*60)
			syschat("You have been cursed.")
			local victim = pc.get_name()
			pc.select(myvid)
			
			say_title("Voodoo Armband:")
			say("")
			say("The player "..victim.." is now cursed for 5 minutes.")
			say("")
			
			item.remove()
			
			
		end
	end
end

These items should be normally present in your client yet unused. If anybody needs I can post the item_proto entries etc.

  • Love 10

Share this post


Link to post

The second quest looks interesting :) Thanks!

  • Love 1

Share this post


Link to post

Guys this anti_exp ring is very very dangerous.

When the player use the exp ring before a level up like 10.9k exp of 11k exp and he activate the exp ring.

After a kill he gains the next level and the exp will be setted by the quest.

After this he kills again a mob and have the (- exp + the next exp).

 

You have to freeze the exp function of the character like this (not the full code):

void CHARACTER::SetExp(DWORD exp)	{ 
	if(!ExpDisabled()) {
		m_points.exp = exp;	
	}
}

Kind regards

Sphinx

Share this post


Link to post

yea players get negative xp from this item in my server too

Share this post


Link to post

For the voodoo armband you should use local variables.

Imagine two players use it at the same time, they would have for example the same random number.

It's a low chance but even possible :D

Share this post


Link to post

Guys this anti_exp ring is very very dangerous.

When the player use the exp ring before a level up like 10.9k exp of 11k exp and he activate the exp ring.

After a kill he gains the next level and the exp will be setted by the quest.

After this he kills again a mob and have the (- exp + the next exp).

 

..code..

 

Kind regards

Sphinx

 

Not true, if the player has less EXP after killing an enemy compared to what he had before, the flag gets set to that new EXP instead.

 

Quote:

if current < pc.getqf("lastexp") then
    pc.setqf("lastexp",current)
end

Share this post


Link to post

Guys this anti_exp ring is very very dangerous.

When the player use the exp ring before a level up like 10.9k exp of 11k exp and he activate the exp ring.

After a kill he gains the next level and the exp will be setted by the quest.

After this he kills again a mob and have the (- exp + the next exp).

 

You have to freeze the exp function of the character like this (not the full code):

void CHARACTER::SetExp(DWORD exp)	{ 
	if(!ExpDisabled()) {
		m_points.exp = exp;	
	}
}

Kind regards

Sphinx

Could you release the full code?
I want the ring when used to set the exp to 0 without receiving any exp.
And when used again, give to the player the exp he had before.

Share this post


Link to post

Voodoo doesn't work for me. When I click on the item doesn't happen anything, I don't even get the message. Anyone know why?

Share this post


Link to post
On 2016. 08. 12. at 0:07 PM, Metin2Place said:

Voodoo doesn't work for me. When I click on the item doesn't happen anything, I don't even get the message. Anyone know why?

Hello,Check item antiflag :)
Item is not activ......
Search another item in itemproto (client & serverside) are avaliable or work in clicking (brave cape) copy antiflag and paste u item...
Best Regards,

Share this post


Link to post

What antiflag should it have?

La 16.02.2017 la 0:10, [007]DawisHU a spus:

Hello,Check item antiflag :)
Item is not activ......
Search another item in itemproto (client & serverside) are avaliable or work in clicking (brave cape) copy antiflag and paste u item...
Best Regards,

What antiflag should have?

Share this post


Link to post
On 15/4/2017 at 10:51 AM, Metin2Place said:

What antiflag should it have?

What antiflag should have?

type 18 of course, the antiflag has nothing to do with it.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
  • Recently Browsing   0 members

    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.