Jump to content
  • 0
valkyrie00

Item equipable in specific map.

Question

Hi everyone,

I was wondering if it's possible to make an item that can be only worn in specific maps. If this is not possible, it is possible for the item to make a player instantly die when it comes into contact with a monster (monster attack)? Or is it possible for the item to have a specific effect when the player equips it (has it equipped) on a certain map?

Thanks!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

I've used a similar system in Arsinoé / Schallmar. So here the code :

Item_db (OnEquip : call function)

29170,Helm of the Champion,Helm of the Champion,5,5000,,10,,5,,0,0xFFFFFFFF,7,2,256,,0,1,510,{bonus2 bAddRace,7,50; bonus3 bAutoSpell,68,10,5; bonus bVit,10;},{callfunc "ars_done";},{}

function	script	ars_done	{
getmapxy([email protected]$,[email protected],[email protected],0);
for(set [email protected], 0; [email protected] < getarraysize([email protected]$); set [email protected], [email protected] + 1) {
	if ([email protected]$[[email protected]] == [email protected]$ || [email protected]$[[email protected]] == [email protected]$ || [email protected]$[[email protected]] == [email protected]$) { set [email protected], [email protected]+1;}
}
if ([email protected] == 1) { end;}

//If Map correct - Check objects
for(set [email protected], 1; [email protected] < 11; set [email protected], [email protected] + 1) {
	for(set [email protected], 0; [email protected] < getarraysize([email protected]); set [email protected], [email protected] + 1) {
		if(getequipid([email protected]) == [email protected][[email protected]]) { 
			if(EP7_LANGUE == 0) { dispbottom "Le '"+getitemname(getequipid([email protected]))+"' n'est pas autorisé sur cette map.";}
			if(EP7_LANGUE == 1) { dispbottom "The '"+getitemname(getequipid([email protected]))+"' isn't authorized in this map.";}
			unequip [email protected];
		}
	}
}
end;
}

-	script	EP7_ConfigurationSchall	-1,{

OnInit:

//Allow items / maps
setarray [email protected]$[0], "tantale_ile","ars_phare","ars_fild01","ars_fild02","ars_fild03","ars_fild04","ars_fild05","ars_fild06","ars_fild07","ars_fild08","ars_fild09","ars_fild10","ars_fild11","ars_fild12","ars_fild13","ars_fild14","ars_fild15","ars_fild16","ars_fild17","ars_fild18","ars_fild19","ars_fild20","ars_fild21","ars_fild22","ars_fild23","ars_fild24","ars_fild25","ars_fild26","ars_fild27","ars_fild28","ars_fild29","ars_fild30","ars_fild31","ars_fild32","ars_fild33","ars_fild34","ars_fild35","ars_fild36","ars_fild37","ars_fild38","ars_fild39","ars_fild40","ars_fild41","ars_fild42","ars_fild43","ars_fild44","ars_fild45","ars_fild46","ars_fild47","ars_fild48","ars_fild49","ars_fild50","ars_fild51","ars_fild52","ars_fild53","ars_fild54","ars_fild55","ars_fild56","ars_fild57","ars_fild58","ars_fild59","ars_fild60","ars_fild61","ars_fild62","ars_fild63","ars_fild64","ars_fild65","ars_fild66","ars_fild67","ars_fild68","ars_fild69","ars_fild70","ars_fild71","ars_fild72","ars_fild73","ars_fild74","ars_fild75","ars_fild76";
setarray [email protected]$[0], "ars_dun01","ars_dun02","ars_dun03","ars_dun04","ars_dun05","ars_dun06","ars_dun07","ars_dun08","ars_dun09","ars_dun10","ars_dun11","ars_dun12","ars_dun13","ars_dun14","ars_dun15","ars_dun16","ars_dun17","ars_dun18","ars_dun19","ars_dun20","ars_dun21","ars_dun22","ars_dun23","ars_dun24","ars_dun25","ars_dun26","ars_dun27","ars_dun28","ars_dun29","ars_dun30","ars_dun31","ars_dun32","ars_dun33","ars_dun34","ars_dun35","ars_dun36","ars_dun37","ars_dun38","ars_dun39","ars_dun40","ars_dun41","ars_dun42","ars_dun43","ars_dun44","ars_dun45","ars_dun46","ars_dun47","ars_dun48","ars_dun49","ars_dun50","ars_dun51","ars_dun52","ars_dun53","ars_dun54","ars_dun55","ars_dun56","ars_dun57","ars_dun58","ars_dun59","ars_dun60","ars_dun61","ars_dun62","ars_dun63","ars_dun64","ars_dun65","ars_dun66","ars_dun67","ars_dun68","ars_dun69","ars_dun70","ars_dun71","ars_dun72","ars_dun73","ars_dun74","ars_dun75","ars_dun76","ars_dun77","ars_dun78","ars_dun79","ars_dun80","ars_dun81","ars_dun82","ars_dun83","ars_dun84","ars_dun85","ars_dun86","ars_dun87","ars_dun88","ars_dun89","ars_dun90","ars_dun91","ars_dun92","ars_dun93","ars_dun94","ars_dun95","ars_dun96";
setarray [email protected]$[0], "ars_in01","ars_in02","ars_in03","ars_in04","ars_in05","ars_in06","ars_in07","ars_in08","ars_in09","ars_in10","ars_in11","ars_in12","ars_in13","ars_in14","ars_in15","ars_in16","ars_in17";
setarray [email protected][0],29170,29171,29172,29173,29174,29175,29176,29177,29178,29179;
}

So you can add maps who allowed the use of items and which ones.

You have also the db/item_noequip.txt to edit :

//Zone 8 - Arsinoe / Schallmar items limitation
1101,512
29170,512
29171,512
29172,512
29173,512
29174,512
29175,512
29176,512
29177,512
29178,512
29179,512

Here mapflag restricted 8 with all maps : http://aerie-pinkpanther.googlecode.com/svn/Schallmar/Server/npc/Schallmar/Mapflags.txt

dic_dun03	mapflag	restricted	8

The mapflag will check at the login which items the character worn and disable them if equipped.

  • Upvote 3
Link to comment
Share on other sites

You can create a function and call it onEquip. This function would then check which map you're on and if it's not the right map it'll take the equipment off or kill you. Problem with this is, you can change maps whenever. It will only check for the map in the map where you equipped the item. I can't think of any other alternative besides having an OnLoadMap event that checks if you're wearing the equipment or not in EVERY map...don't think that's very efficient to code.

Link to comment
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.   Paste as plain text instead

  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.



×
×
  • Create New...

Important Information

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