Jump to content
  • 0
Sign in to follow this  
mybitch

Creating an item that can be used only in Battlegrounds

Question

7 answers to this question

Recommended Posts

  • 0

For usable items you can use a map zone restriction: just disable it on the "All" zone and enable it on the Battleground zone.

 

For items used by skills, that's a bit more complicated and maybe you need a source mod.

 

Why you don't check out this source mod? May be useful for what you want: http://herc.ws/board/topic/425-bg-consume-mapflag-battlegrounds-items-that-can-only-be-used-in-bg/

Share this post


Link to post
Share on other sites
  • 0

 

-    script    bg_noequip    -1,{OnPCLoadMapEvent:    if(getmapflag(strcharinfo(3),mf_battleground) {        if(isequipped(2220) unequip 2220;    // Hat        if(isequipped(2222) unequip 2222;    // Turban    }    end;    }

 

Give this a try; just make sure your battlegrounds maps have the loadevent mapflag set.

Share this post


Link to post
Share on other sites
  • 0

For usable items you can use a map zone restriction: just disable it on the "All" zone and enable it on the Battleground zone.

 

For items used by skills, that's a bit more complicated and maybe you need a source mod.

 

Why you don't check out this source mod? May be useful for what you want: http://herc.ws/board/topic/425-bg-consume-mapflag-battlegrounds-items-that-can-only-be-used-in-bg/

 

Is there a way not to edit src files? cause its hard to update hercules when there's modification :(

Share this post


Link to post
Share on other sites
  • 0

 

For usable items you can use a map zone restriction: just disable it on the "All" zone and enable it on the Battleground zone.

 

For items used by skills, that's a bit more complicated and maybe you need a source mod.

 

Why you don't check out this source mod? May be useful for what you want: http://herc.ws/board/topic/425-bg-consume-mapflag-battlegrounds-items-that-can-only-be-used-in-bg/

 

Is there a way not to edit src files? cause its hard to update hercules when there's modification :(

Have you tried these?

 

You can try this.

 

getmapflag("<map name>",mf_battleground)

 

 

 

-    script    bg_noequip    -1,{OnPCLoadMapEvent:    if(getmapflag(strcharinfo(3),mf_battleground) {        if(isequipped(2220) unequip 2220;    // Hat        if(isequipped(2222) unequip 2222;    // Turban    }    end;    }

 

Give this a try; just make sure your battlegrounds maps have the loadevent mapflag set.

Share this post


Link to post
Share on other sites
  • 0

I believe I misunderstood the request. Here's a revised script and response:

 

 

-    script    bg_equip    -1,{OnPCLoadMapEvent:    if(!getmapflag(strcharinfo(3),mf_battleground) {        if(isequipped(2220) unequip 2220;    // Hat        if(isequipped(2222) unequip 2222;    // Turban    }    end;    }

 

Just replace the item IDs with your own and add new lines accordingly. This script reads as:

 

When a player loads a map:

If they're not on a Battlegrounds map,

unequip their Hat if they're wearing one;

unequip their Turban if they're wearing one;

 

It's usage would be in a situation where you would want Hats and Turbans to be exclusively used in Battlegrounds. You could add additional prevention by adding a condition to the item's OnEquip script in item_db2.txt

 

 

2222,Turban,Turban,5,4500,,300,,3,,0,0xFFFFFFFE,7,2,256,,0,1,7,{},{ if(!getmapflag(strcharinfo(3),mf_battleground) unequip 2222; message strcharinfo(0), "This item can only be worn in Battlegrounds."; },{}

 

This script reads: If you're not on a Battlegrounds map, unequip this Turban when it's equipped and display an error message.

 

if(!getmapflag(strcharinfo(3),mf_battleground) unequip 2222; message strcharinfo(0), "This item can only be worn in Battlegrounds.";

 

 

If these limitations are for custom equipment, just use your custom item IDs. If you just want to make a custom potion or consumable of some sort, add a condition to the main script:

 

 

501,Red_Potion,Red Potion,0,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ if(!getmapflag(strcharinfo(3),mf_battleground) { getitem 501; message strcharinfo(0), "This item can only be used in Battlegrounds."; } else itemheal rand(45,65),0; },{},{}

 

This script reads: If you're not on a Battlegrounds map, get a new potion (to replace the one you just used) and display an error message; otherwise, heal.

 

if(!getmapflag(strcharinfo(3),mf_battleground) { getitem 501; message strcharinfo(0), "This item can only be used in Battlegrounds."; } else  itemheal rand(45,65),0;
Edited by Via

Share this post


Link to post
Share on other sites
  • 0

Goto map_zone_db.conf

In zone with name: "All"

Put the id you want to disable

example Red_Potion or itemd id: 501

	disabled_items: {	   Red_Potion: true	}

And then...

To enable the Red_Potion on Battlegounds Map..

scroll down and go to zone with name: "Battlegrounds"

Add Red_Potion and set to false if you want to disable

like this:

 

disabled_items: {
Assumptio_5_Scroll: true
Pty_Assumptio_Scroll: true
Red_Potion: false
}

 

:)

Edited by kyeme

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.