Jump to content

AnnieRuru

Members
  • Posts

    2044
  • Joined

  • Last visited

  • Days Won

    51

Posts posted by AnnieRuru

  1. 17 hours ago, TheDerpySupport said:

    It means it generates a number at random 1~50 and if it lands on 1, 2, or 3 you win; You can either lower the rand(50) or increase the number less than to look for.

    correction ....

    rand(2) actually produce number 0 or 1 ..

    if ( rand(50) < 4 ) actually means 4 out 50, means land on 0,1,2,3 is true condition, 4~49 is false condition

    when you quote the code ... didn't you see it has case 0: ?
    and the default: case is actually case 14:

  2. 12 hours ago, MukkiesftKies said:

    Thanks all, this script working properly. /thx

    i just change my sql table
    Type 
    int(11) to varchar(30)

    I think you just have to change your INT(11) UNSIGNED into INT(11) SIGNED
    yeah I reproduce your error

    [SQL]: DB error - BIGINT UNSIGNED value is out of range in '(`rathena`.`pvpladder`.`points` - 14)'
    [Debug]: at d:\ragnarok\rathena\src\map\script.cpp:16882 - insert into `pvpladder` value ( 150001, 'EnnyRuru', 0 ) on duplicate key update `points` =  IF( points - 14 < 0, 0, points - 14)
    [Debug]: Source (NPC): kjsdhfj at prontera (155,185)

    if you make your `points` field as varchar(30), then when you list out the top 10 players,
    let's say player A has 20 points and player B has 9 points,
    the script will show player B has higher score than player A, because the number '9' is bigger than number '2' (remember this is a string)
    you have to cast the `points` field as Integer like this

    SELECT * FROM `pvpladder` ORDER BY CAST(`points` AS SIGNED) DESC;

     

    Spoiler
    
    /*
    create table pvpladder (
    char_id int(11) primary key,
    name varchar(23),
    #points int(11),
    #points varchar(30),
    points int(11) unsigned,
    key (points)
    ) engine = innodb;
    */
    
    prontera,155,185,5	script	kjsdhfj	1_F_MARIA,{
    	mes "Rankings :->";
    	.@query$  = "SELECT `name`, IF(@d=t.`points`, @r, @r:=@i), @d:=t.`points`, @i:=@i+1 ";
    	.@query$ += "FROM `pvpladder` t, (SELECT @d:=0, @r:=0, @i:=1)q ";
    	.@query$ += "ORDER BY `points` DESC LIMIT 10";
    	.@nb = query_sql(.@query$, .@name$, .@rank, .@points, .@dummy);
    	if ( !.@nb ) {
    		mes "  No entry.";
    		close;
    	}
    	for ( .@i = 0; .@i < .@nb; ++.@i )
    		mes .@rank[.@i] +". "+ .@name$[.@i] +" -> "+ .@points[.@i] +" points";
    	next;
    	if ( !query_sql( "SELECT `points`, 1+(SELECT COUNT(1) FROM `pvpladder` t1 WHERE t1.`points` > t2.`points`) FROM `pvpladder` t2 WHERE `char_id` = "+ getcharid(0), .@points, .@rank ) ) {
    		mes "You haven't kill anyonw";
    		close;
    	}
    	mes "You have "+ .@points +" Points";
    	mes "Your current rank is No."+ .@rank;
    	close;
    OnPCKillEvent:
    	if ( killedrid == getcharid(3) ) end;
    	.@killpoints = rand(10,20);
    	.@deadpoints = rand(10,20);
    	query_sql "insert into `pvpladder` value ( "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', "+ .@killpoints +" ) on duplicate key update `points` = `points` + "+ .@killpoints;
    	query_sql "select points from pvpladder where char_id = "+ getcharid(0), .@points;
    	dispbottom "You have earned "+ .@killpoints +" Points. Total "+ .@points +".";
    	attachrid killedrid;
    	query_sql "insert into `pvpladder` value ( "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', 0 ) on duplicate key update `points` =  IF( points - "+ .@deadpoints +" < 0, 0, points - "+ .@deadpoints  +")";
    	query_sql "select points from pvpladder where char_id = "+ getcharid(0), .@points;
    	dispbottom "You have lose "+ .@deadpoints +" Points. Total "+ .@points +".";
    	end;
    }

     

  3. since you want this as equipments, you have to add new skills
    and adding new skills is never simple

    https://github.com/rathena/rathena/wiki/Adding_new_skills

    yes, just like TheDerpySupport said, when you shout the skill name, the skill level is not included
    which means, you have to make 20 new skills, with each skill having just 1 level, and each skill ID has different name to shout the number you want

    cannot done with scripting or database alone
    this is probably source modification

  4. apparently most of the anti-bot out there that uses SC_BERSERK to mute the players, actually can be bypass by opencore
    https://github.com/HerculesWS/Hercules/pull/937#issuecomment-165323552

    I wish rathena actually has this *setpcblock script command that just merge into hercules days ago
    https://github.com/HerculesWS/Hercules/pull/842

    so nope, until rathena actually has its own script command to disable player from using atcommand ...

     

    nvm, just write one right now for hercules ones

    -	script	anti-bot	FAKE_NPC,{
    OnNPCKillEvent:
    	if ( getmapflag( strcharinfo(PC_MAP), mf_nosave ) )
    		end; // never trigger anti-bot on event maps
    	++@anti_bot_mob_killed;
    	if ( @anti_bot_mob_killed < 100 ) end;
    	setpcblock PCBLOCK_MOVE | PCBLOCK_ATTACK | PCBLOCK_SKILL | PCBLOCK_USEITEM | PCBLOCK_IMMUNE | PCBLOCK_COMMANDS, true;
    	.@a = rand(1,9);
    	.@b = rand(0, 9 - .@a);
    	mes "What is the number";
    	mes .@a +" + "+ .@b +" = ?";
    	next;
    	input .@ans, 1, 10;
    	if ( .@a + .@b != .@ans ) {
    		++#anti_bot_wrong_answer;
    		if ( #anti_bot_wrong_answer >= 3 ) {
    			atcommand "@jailfor 30m "+ strcharinfo(PC_NAME);
    			end;
    		}
    		mes "wrong answer";
    		close2;
    		setpcblock PCBLOCK_COMMANDS, false; // hmm ....
    		atcommand "@kick "+ strcharinfo(PC_NAME);
    		end;
    	}
    	mes "ok you are free to go";
    	#anti_bot_wrong_answer = 0;
    	setpcblock PCBLOCK_MOVE | PCBLOCK_ATTACK | PCBLOCK_SKILL | PCBLOCK_USEITEM | PCBLOCK_IMMUNE | PCBLOCK_COMMANDS, false;
    	close;
    }

     

  5. announce "[Fast-Type Event] : Next round starts in 5 seconds.",bc_map,0x00FFFF;
    	---- Change into ---->
    announce "[Fast-Type Event] : Next round starts in 5 seconds.",bc_map|bc_npc,0x00FFFF;

    almost all of it needs to add bc_npc flag for the 1st script

     

    2nd script however need to use mapannounce, since the monster spawn in other maps

    announce "[Find the Plant] : "+.spawnplant+" plants have been spawned in the event area.",bc_map,0x00FFFF;
    	------ Change into ----->
    mapannounce .Map$, "[Find the Plant] : "+.spawnplant+" plants have been spawned in the event area.", bc_map, 0x00FFFF;

     

  6. prontera,155,185,5	script	Click-The-Pub	1_F_MARIA,{
    	end;
    OnWhisperGlobal:
    	if ( getgmlevel() >= 99 )
    		goto OnMinute00;
    	end;
    OnMinute00:
    	delwaitingroom;
    	waitingroom "Click ME", 2, strnpcinfo(0)+"::OnWinner", 1;
    	end;
    OnWinner:
    	warpwaitingpc "prontera", 155, 182, 1;
    	attachrid $@warpwaitingpc;
    	if ( !checkweight( 501,1 ) ) {
    		dispbottom "LOL you don't have enought space to get a reward";
    		end;
    	}
    	getitem 501, 1;
    	announce "Click the Pub: Winner is "+ strcharinfo(0) +" !!", bc_all;
    	delwaitingroom;
    	end;
    }

     

    • Love 1
  7. @caspa , too simple ...

    prontera,155,185,5	script	Click-The-Pub	1_F_MARIA,{
    	end;
    //OnInit:
    	bindatcmd "test", strnpcinfo(0)+"::OnMinute00";
    	end;
    OnMinute00:
    	delwaitingroom;
    	waitingroom "Click ME", 2, strnpcinfo(0)+"::OnWinner", 1;
    	end;
    OnWinner:
    	getwaitingroomusers;
    	attachrid .@waitingroom_users;
    	if ( !checkweight( 501,1 ) ) {
    		dispbottom "LOL you don't have enought space to get a reward";
    		kickwaitingroomall;
    		end;
    	}
    	getitem 501, 1;
    	announce "Click the Pub: Winner is "+ strcharinfo(0) +" !!", bc_all;
    	delwaitingroom;
    	end;
    }

    btw I remember you said you are using eamod ...
    I don't think your server has *getwaitingroomusers ?

    • Upvote 1
  8. eh ...
    1. showing value from `char_reg_num` is not thread-safe ...
    2. `value` field from `char_reg_num` is not index ...

    well it seems the whole rathena community love to use this method ...
    I'm not going to comment anymore

     

     

    if(killerrid >= 2000000)

    I think this condition is not needed for OnPCDieEvent
    if he uses OnPCDieEvent, then we assume it will trigger whenever the player die .. no matter from which source

    if he wants to make it trigger by player kill only then should have OnPCKillEvent, and attachrid killedrid; later

    however the OnPCKillEvent need the killedrid check though,
    Grand-Cross killing self can trigger both OnPCKillEvent and OnPCDieEvent

     


    PS: I got notification several times while you editing your post

    @sader1992

    testing Mention ....

     

  9. On 6/4/2018 at 7:54 PM, sader1992 said:

    i suggest you just use character variables , it's better for your script

    curious .... do you actually mean telling others to make their own ladder type algorithm ... script ?
    I'm actually interested if you can show me your txt style ladder script ?

     

     

    On 6/4/2018 at 3:36 PM, MukkiesftKies said:

    so this script working. but after player point going to 0. my map show this .

    
    [SQL]: DB error - BIGINT UNSIGNED value is out of range in '(`ragnarok`.`mvp_ranking`.`points` - 11)'
    [Debug]: at e:\game\ro\rathena-master\src\map\script.cpp:16697 - insert into `mvp_ranking` value ( 150002, 'lolo', 1 ) on duplicate key update `points` = `points` - 11
    [Debug]: Source (NPC): MVP Rank at livion (148,149)

     

    .@rand = rand(10,20);
    query_sql "insert into `mvp_ranking value ( "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) "', 0 ) on duplicate key update points = IF( points - "+ .@rand +" < 0, 0, points - "+ .@rand +" )";

     

    • Upvote 1
  10. #should be `points`
    on duplicate key update `points` = `points` + "+ rand(100,1000);
    on duplicate key update `points` = `points` + " .@points;
    
    
    #SQL rand()
    on duplicate key update `points` = `points` + floor( rand() * (1000-100+1) )+100;"

     

    PS: your OnPCDieEvent: should use killerrid instead of killedrid

    Spoiler
    
    on duplicate key update `points` = `points` + floor( rand()*100 )*10;

    sry this was wrong answer, sometimes rand() can random as 0.01 ...
    means 0.01 * 100 = 1 * 10 = 10
    but he request rand(100,1000) means it shouldn't random to get number 10

     

    • Upvote 2
  11. 19 hours ago, kamirie said:

    A follow up question.Do you think this will be a resource hog since it's querying ?

    then how about I ask back ...
    do you think *announce with bc_all flag will lag your server ?

    if your answer is no, then *addrid also doesn't lag your server
    both does the same thing with manipulate data to all players

    *query_sql should be very fast, and if you index the `nameid` field, yeah it will return result faster

     

    EDIT: some time later

    select name from inventory left join `char` on inventory.char_id = `char`.char_id where nameid = 501 and online = 0;
    select name from ( select char_id from inventory where nameid = 501 ) as aaa left join ( select char_id, name from `char` where online = 0 ) as bbb on aaa.char_id = bbb.char_id;
    select char_id as cid, ( select name from `char` where char_id = cid ) from inventory where nameid = 501;

    well all 3 commands should return same result ... just testing
    I think ... since the `char_id` field has been indexed in both tables, table JOIN should works fine I guess

    • Upvote 1
  12. 1 hour ago, kamirie said:

    I tested this and it do show the result but it doesn't clear the result after the player stop talking with the npc. It saves it like a history .

    HAHAHA /heh
    sometimes I do get this silly mistakes

     

    prontera,155,185,5	script	ksdfhksdjf	1_F_MARIA,{
    	mes "select an item ID";
    	next;
    	.id = .itemid[ select( .menu$ ) -1 ];
    	donpcevent strnpcinfo(0) +"::OnGetAID";
    	mes "These are the players having";
    	mes "^0000FF"+ getitemname(.id) +"^000000 in their inventory.";
    	for ( .@i = 0; .@i < .c; ++.@i )
    		mes (.@i +1) +". "+ .name$[.@i];
    	close;
    OnGetAID:
    	.c = 0;
    	addrid 0;
    	if ( countitem(.id) )
    		.name$[.c++] = strcharinfo(0);
    	end;
    OnInit:
    	setarray .itemid,
    		501, 502, 503, 504, 505; // add more item here to show
    	.@size = getarraysize(.itemid);
    	for ( .@i = 0; .@i < .@size; ++.@i )
    		.menu$ += getitemname(.itemid[.@i]) +":";
    	end;
    }

     


     

    On 6/1/2018 at 9:58 AM, kamirie said:

    The scan will show ALL owner online or offline 

    omg ... I guess have to use query_sql after all ...

    prontera,155,185,5	script	ksdfhksdjf	1_F_MARIA,{
    	mes "select an item ID";
    	next;
    	.id = .itemid[ select( .menu$ ) -1 ];
    	.@id = .id;
    	donpcevent strnpcinfo(0) +"::OnGetAID";
    	mes "These are ^009900Online^000000 players having";
    	mes "^0000FF"+ getitemname(.@id) +"^000000 in their inventory.";
    	for ( .@i = 0; .@i < .c; ++.@i )
    		mes (.@i +1) +". "+ .name$[.@i];
    	next;
    	mes "These are ^FF0000Offline^000000 players having";
    	mes "^0000FF"+ getitemname(.@id) +"^000000 in their inventory.";
    	.@nb = query_sql( "select name from inventory left join `char` on inventory.char_id = `char`.char_id where `char`.online = 0 and inventory.nameid = "+ .@id, .@name$ );
    	for ( .@i = 0; .@i < .@nb; ++.@i )
    		mes (.@i +1) +". "+ .@name$[.@i];
    	close;
    OnGetAID:
    	.c = 0;
    	addrid 0;
    	if ( countitem(.id) )
    		.name$[.c++] = strcharinfo(0);
    	end;
    OnInit:
    	setarray .itemid,
    		501, 502, 503, 504, 505; // add more item here to show
    	.@size = getarraysize(.itemid);
    	for ( .@i = 0; .@i < .@size; ++.@i )
    		.menu$ += getitemname(.itemid[.@i]) +":";
    	end;
    }

     

  13. eh ... sorry about left this topic out

    there is also another way to mine the treasure chest like I did in treasure chest pvp event
    (sry the script is too old and in the middle of fixing it)

    -	script	main	FAKE_NPC,{
    OnInit:
    	bindatcmd "event", strnpcinfo(0)+"::Onaaa", 99,99;
    	for ( .@i = 0; .@i < 20; ++.@i )
    		disablenpc "Treasure Chest#"+ .@i +"_ev";
    	end;
    Onaaa:
    	if ( .start == false && ( compare( .@atcmd_parameters$, "on" ) || compare( .@atcmd_parameters$, "start" ) ) )
    		goto OnStart;
    	if ( .start == true && ( compare( .@atcmd_parameters$, "off" ) || compare( .@atcmd_parameters$, "end" ) ) )
    		goto OnEnd;
    	end;
    OnStart:
    	.start = true;
    	++.event_id;
    	for ( .@i = 0; .@i < 20; ++.@i ) {
    		while ( checkcell( "prontera", .@x = rand(148,179), .@y = rand(163,191), cell_chknopass ) );
    		movenpc "Treasure Chest#"+ .@i +"_ev", .@x, .@y;
    		enablenpc "Treasure Chest#"+ .@i +"_ev";
    		.deny[.@i] = 0;
    	}
    	end;
    OnEnd:
    	.start = false;
    	for ( .@i = 0; .@i < 20; ++.@i )
    		disablenpc "Treasure Chest#"+ .@i +"_ev";
    	end;
    OnPCLogoutEvent:
    	if ( @treasu_ev_ )
    		.deny[ @treasu_ev_ ] = 0;
    	end;
    }
    
    -	script	treasu_ev	FAKE_NPC,{
    	.@id = strnpcinfo(2);
    	if ( @treasu_ev_event_id == getvariableofnpc( .event_id, "main" ) ) {
    		showscript "[Treasure Chest] You have digged treasure chest in this round.", getcharid(3), SELF;
    		end;
    	}
    	if ( getvariableofnpc( .deny[.@id], "main" ) ) {
    		showscript "[Treasure Chest] Somebody else is digging this treasure chest.", getcharid(3), SELF;
    		end;
    	}
    	set getvariableofnpc( .deny[.@id], "main" ), getcharid(3);
    	@treasu_ev_ = .@id;
    	doevent "main::OnPCLogoutEvent";
    	progressbar "", 5; // time to capture, 5 seconds
    	getitem 501, 1;
    	@treasu_ev_event_id = getvariableofnpc( .event_id, "main" );
    	disablenpc strnpcinfo(0);
    	movenpc "Treasure Chest#"+ .@i +"_ev", 0, 0;
    	end;
    }
    
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#0_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#1_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#2_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#3_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#4_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#5_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#6_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#7_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#8_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#9_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#10_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#11_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#12_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#13_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#14_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#15_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#16_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#17_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#18_ev	1324
    prontera,0,0,0	duplicate(treasu_ev)	Treasure Chest#19_ev	1324

     

  14. curious then ...

    let's say a member wants a feature implement ...
    and have enough cash want to kick start a campaign ...
    but the feature is not listed in the crowdfunding list ...
    so how members going to start a petition for a support ?

    maybe add another subforum for the discussion ?

    because I don't think its a good idea for members to just open a crowdfunding project easily
    should have a leader behind to monitor them

  15. this actually reminds me during eathena days, there were bounty ...
    back in those day we were using SVN so there was no pull request ...

    maybe its time to bring this feature back

    how they did ?
    1. members put a bounty on a project they like to implement
    2. the developers, or whoever get it done get part of the bounty payment

    of course, if I still remember well, this idea was dropped soon after because this promote developers getting lazy and only do for the bounty
    well, but in my opinion, it was such a nice idea

     

    let me recall some of the important points of the discussion ... because eathena board was no more ...
    1. how the members going to put a bounty ... and who going to manage the money ...
    2. if I still remember correctly, the bounty can only issue by developers, usually issue for official script that needs IRO confirmation,
    or something like iro script convertion ... etc
    yeah, I remember at the time, I don't know why they don't allow members put a bounty ... maybe because they usually asked for unofficial request ?
    3. put a bounty on a project to get it done faster, or bounty on things that's not many wants to do, but a popular feature.....
    4. can't really remember at the moment ...

    but anyhow ... discuss ~

     

    EDIT: ... ohh....
    https://rathena.org/board/crowdfunding/category/1-rathena-forums/

  16. heck, they use *query_sql, which is not thread-safe
    better use *addrid

    prontera,155,185,5	script	ksdfhksdjf	1_F_MARIA,{
    	mes "input item ID";
    	next;
    	input .id, 0, 65535;
    	if ( !.id ) close;
    	if ( getitemname(.id) == "null" ) {
    		mes "item ID doens't exist";
    		close;
    	}
    	donpcevent strnpcinfo(0) +"::OnGetAID";
    	copyarray .@name$, .name$, .c;
    	.@c = .c;
    	copyarray .@cname$, .cname$, .cc;
    	.@cc = .cc;
    	copyarray .@sname$, .sname$, .sc;
    	.@sc = .sc;
    	copyarray .@gname$, .gname$, .gc;
    	.@gc = .gc;
    	while (true) {
    		switch( select( "Inventory", "Cart", "Storate", "Guild Storage" ) ) {
    		case 1:
    			mes "Inventory";
    			for ( .@i = 0; .@i < .@c; ++.@i )
    				mes (.@i +1) +". "+ .@name$[.@i];
    			break;
    		case 2:
    			mes "Cart";
    			for ( .@i = 0; .@i < .@cc; ++.@i )
    				mes (.@i +1) +". "+ .@cname$[.@i];
    			break;
    		case 3:
    			mes "Storage";
    			for ( .@i = 0; .@i < .@sc; ++.@i )
    				mes (.@i +1) +". "+ .@sname$[.@i];
    			break;
    		case 4:
    			mes "Guild Storage";
    			for ( .@i = 0; .@i < .@gc; ++.@i )
    				mes (.@i +1) +". "+ .@gname$[.@i];
    			break;
    		}
    		next;
    	}
    	end;
    OnGetAID:
    	.c = .cc = .sc = .gc = 0;
    	addrid 0;
    	if ( countitem(.id) ) .name$[.c++] = strcharinfo(0);
    	if ( cartcountitem(.id) ) .cname$[.cc++] = strcharinfo(0);
    	if ( storagecountitem(.id) ) .sname$[.sc++] = strcharinfo(0);
    	if ( guildstoragecountitem(.id) ) .gname$[.gc++] = strcharinfo(0);
    	end;
    }

    EDIT for below : LOL forgot to reset the variables /heh

  17. How to use *addrid script command properly

    Method 1: Exploits its multi-concurrent run
    -> use *addrid right before ending the script

    addrid will run multiple instances equal to number of player attached, which, not entirely a bad thing
    when use properly, as shown below, don't have to use loop

    prontera,155,179,5	script	kickall	1_F_MARIA,{
    	if ( getgmlevel() < 99 ) end;
    	mes "I will kick all players after this dialog close";
    	mes "Exclude: autotrader, GMs, wondering in town.";
    	close2;
    	addrid 0;
    	if ( getgmlevel() >= 60 ) end; // don't kick GMs
    	if ( checkvending() & 2 ) end; // shouldn't kick @autotraders
    	if ( getmapflag( strcharinfo(3), mf_town ) ) end; // doesn't kick anyone in the town
    	atcommand "@kick "+ strcharinfo(0);
    	end;
    }


    Method 2: Get all the RID in an array
    -> use donpcevent as calling a function, within that label, store the account IDs

    the preferred method, this method is safe from running multiple instances

    prontera,155,182,5	script	getallusers	1_F_MARIA,{
    	donpcevent strnpcinfo(0)+"::OnGetAID"; // treat this as calling a function to get online player's account ID
    	for ( .@i = 0; .@i < .c; ++.@i )
    		announce (.@i +1)+". "+ rid2name(.aid[.@i]), bc_all;
    	end;
    OnGetAID:
    	.c = 0;
    	addrid 0;
    	.aid[.c++] = getcharid(3);
    	end;
    }
    -	script	getallmap	HIDDEN_NPC,{
    	end;
    OnTest:
    	donpcevent strnpcinfo(0)+"::OnGetAID";
    	for ( .@i = 0; .@i < .c; ++.@i )
    		announce (.@i +1)+". "+ rid2name(.aid[.@i]), bc_all;
    	end;
    OnGetAID:
    	.c = 0;
    	addrid 5, 0, "payon"; // only attach to everyone inside payon map
    	.aid[.c++] = getcharid(3);
    	end;
    OnInit:
    	bindatcmd "test", strnpcinfo(0)+"::OnTest";
    	end;
    }
    guild_vs2,0,0,0	script	getareausers	HIDDEN_NPC,{
    	end;
    OnTest:
    	donpcevent strnpcinfo(0)+"::OnGetAID";
    	for ( .@i = 0; .@i < .c; ++.@i )
    		announce (.@i +1)+". "+ rid2name(.aid[.@i]), bc_all;
    	end;
    OnGetAID:
    	.c = 0;
    	addrid 4, 0, 46, 46, 53, 53; // attach everyone in the map 'guild_vs2' of (46,46,53,53) area
    	.aid[.c++] = getcharid(3);
    	end;
    OnInit:
    	bindatcmd "test2", strnpcinfo(0)+"::OnTest";
    	end;
    }


     

    • Upvote 1
    • Love 1
    • MVP 1
×
×
  • Create New...