Jump to content
  • 0

request for one card holder per guild


POGING UTOY

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   0
  • Joined:  04/18/20
  • Last Seen:  

hi guys i want to request this script 

only one holder of specific item/card per guild ( inside woe castle ) sample gtb card only one person in your guild can equip it, if other member tried  to equip he/she is automatic kick in the castle

Edited by POGING UTOY
wrong grammar
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

Yeah ok this is my first attempt it's completely untested and probably not going to work. Also it's horrendous this is probably better done with source tbh.

-	script	CardHolderThing	-1,{
OnPCStatCalcEvent:
OnPCLoadMapEvent:
	.@equipped = true;
	if(inarray(.maps$,strcharinfo(3)) != -1) {
		for(.@a = 0; .@a < .slotlen; .@a++)
			.@equipped &= !getequipcardcnt(.slots[.@a]);
		if(.@equipped)
			end;
		for(.@a = 0; .@a < .slotlen; .@a++) {
			if(inarray(.@itemids,getequipid(.slots[.@a])) == -1) {
				.@itemids[getarraysize(.@itemids)] = getequipid(.slots[.@a]);
				for(.@i = 0; .@i < 4; .@i++) {
					.@cardid = getequipcardid(.slots[.@a],.@i);
					if(.@cardid >= 4000) {
						getmapunits(BL_PC,strcharinfo(3),.@mapusers[0]);
						// Add player to ongoing list.
						for(.@j = 0; .@j < getarraysize(.@mapusers); .@j++) {
							if(inarray(getd("."+strcharinfo(3)+"_mapusers"), .@mapusers[.@j]) != -1) {
								setd "."+strcharinfo(3)+"_mapusers["+getarraysize(getd("."+strcharinfo(3)+"_mapusers"))+"]", .@mapusers[.@j];
							}
						}
						for(.@j = 0; .@j < getarraysize(getd("."+strcharinfo(3)+"_mapusers")); .@j++) {
							// Remove player and item list.
							if(inarray(.@mapusers, getd("."+strcharinfo(3)+"_mapusers["+.@j+"]")) != -1) {
								deletearray "."+strcharinfo(3)+"_"+getd("."+strcharinfo(3)+"_mapusers["+.@j+"]")+"_mapitems";
								deletearray getd("."+strcharinfo(3)+"_mapusers["+.@j+"]"), 1;
							} 
							// Searching through lists of map players cards...
							else if(getcharid(3) != getd("."+strcharinfo(3)+"_mapusers["+.@j+"]")) {
								if(inarray(getd("."+strcharinfo(3)+"_"+getd("."+strcharinfo(3)+"_mapusers["+.@j+"]")+"_mapitems"), .@cardid) != -1) {
									warp "prontera",0,0;
									dispbottom  "You've been removed from the map because someone else is already using "+getitemname(.@cardid)+".";
									end;
								}
							}
						}
						// Adding card to the current players list.
						setd "."+strcharinfo(3)+"_"+getcharid(3)+"_mapitems["+getarraysize(getd("."+strcharinfo(3)+"_"+getcharid(3)+"_mapitems"))+"]", .@cardid;
					}
				}
			}
		}
	}
	end;
OnInit:
	setarray .slots, EQI_ACC_L, EQI_ACC_R, EQI_GARMENT, EQI_HEAD_LOW, EQI_HEAD_MID, EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_SHOES;
	setarray .maps$, "alde_gld", "aru_gld", "gef_fild13";
	.slotlen = getarraysize(.slots);
	for(.@a = 0; .@a < getarraysize(.maps$); .@a++)
		setmapflag .maps$[.@a], mf_loadevent;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   0
  • Joined:  04/18/20
  • Last Seen:  

you're right its not working i hope someone will make it work

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

may try this.

https://pastebin.com/raw/4xgQ2Krr

however, this cant auto handle the scenario where the player left the guild after he registered as the member who using the GTB during WOE.

But if you are a guild master, then you may try to use the command [at]gmreset to force your guild member (even if left guild) reset it.

  • Love 1
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...