Jump to content

Capuche

Developer
  • Posts

    2407
  • Joined

  • Last visited

  • Days Won

    52

Everything posted by Capuche

  1. In your script quiz_01 mapflag restricted 1 So add the items ID you want to restrict in db/re/item_noequip.txt
  2. In your script sleep 2000; announce "Devil Square : Treasure Box Spawn Has Been Delayed To Prevent Stealing", bc_map; sleep don't keep the rid but bc_map in the announce need a player attached Just change sleep to sleep2 to keep the rid
  3. Strange it seems working in my local server
  4. //===== eAthena Script ======================================= //= Item Rewards NPC //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.8 //===== Description: ========================================= //= Useful for event rewards, when a player is not necessarily online. //= Logging is available, if needed (holds 128 names). //= Note: Unclaimed rewards are limited to 64 at a time. //============================================================ prontera,156,195,6 script Item Rewards 836,{ // --------------------- Config --------------------- // Package format is "ID1,Count1,ID2,Count2,..." // GM Access: Level required to open the GM menu. // GM Delete: Level required to erase entries. // GM Logging: Level required to manage logs. set .GMAccess,60; set .GMDelete,80; set .GMLogging,99; set .PackageCount,3; setarray .Package1[0],501,1,502,2,503,3; setarray .Package2[0],601,5,602,10; setarray .Package3[0],607,10; // -------------------------------------------------- if (getgmlevel() >= .GMAccess) goto GM_Menu; mes "[Item Rewards]"; set .@i,0; while (.@i < getarraysize($itemreward$)) { if (strcharinfo(0) == $itemreward$[.@i]) goto GetReward; set .@i, .@i+2; } mes "You have no rewards pending."; close; GetReward: if (((Weight*100)/MaxWeight) > 49) { mes "You are over the weight limit."; close; } if (!checkweight(5055,getarraysize(getd(".Package"+$itemreward$[.@i+1])))) { mes "Clear space in your inventory."; close; } set .@j,0; while (.@j < getarraysize(getd(".Package"+$itemreward$[.@i+1]))) { getitem getd(".Package"+$itemreward$[.@i+1]+"["+.@j+"]"),getd(".Package"+$itemreward$[.@i+1]+"["+(.@j+1)+"]"); set .@j, .@j+2; } specialeffect2 248; announce "[GM] "+ $gm_name_reward$[.@i] +" has rewarded "+ strcharinfo(0) +" with (Package "+ $itemreward$[.@i+1] +".)", 0; deletearray $itemreward$[.@i],2; deletearray $gm_name_reward$[.@i],1; mes "Here you go!"; close; OnMinute00: OnMinute30: if (!getarraysize($itemreward$)) end; set .@i,0; while (.@i < getarraysize($itemreward$)) { message $itemreward$[.@i],"[You have a reward pending. See the Item Rewards NPC.]"; sleep 10; set .@i, .@i+2; } end; GM_Menu: mes "[Item Rewards]"; mes "What would you like to do?"; next; switch(select(" ~ ^FF55FFPackage information^000000: ~ ^FF55FFList unclaimed rewards^000000: ~ ^00D900Give a reward^000000: ~ "+((getgmlevel()<.GMDelete)?"^777777":"^DE0000")+"Delete a reward^000000: ~ "+((getgmlevel()<.GMDelete)?"^777777":"^DE0000")+"Delete all unclaimed rewards^000000: ~ "+((getgmlevel()<.GMLogging)?"^777777":"^55AAFF")+"Manage logs^000000: ~ [Close]")) { case 1: mes "[Item Rewards]"; set .@j,1; while (getd(".Package"+.@j)) { mes "^660099Package " + .@j + ":^000000"; set .@i,0; while (.@i < getarraysize(getd(".Package"+.@j))) { mes " ~ " + getd(".Package"+.@j+"["+(.@i+1)+"]") + "x " + getitemname(getd(".Package"+.@j+"["+(.@i)+"]")); set .@i, .@i+2; } set .@j, .@j+1; } next; goto GM_Menu; case 2: mes "[Item Rewards]"; mes "Used space: ^F52887" + (getarraysize($itemreward$)/2) + "^000000/64"; mes "--------------------------------"; set .@i,0; while (.@i < getarraysize($itemreward$)) { mes "^B041FF" + $itemreward$[.@i] + "^000000: package #" + $itemreward$[.@i+1]; set .@i, .@i+2; } next; goto GM_Menu; case 3: mes "[Item Rewards]"; if (getarraysize($itemreward$) > 127) { mes "No more names can be stored."; mes "Delete some values and try again."; next; goto GM_Menu; } mes "Input a name, then a package number."; input .@name$; query_sql "SELECT `char_id` FROM `char` WHERE `name` = '"+.@name$+"'",.@charid; if (!.@charid) { mes "The name is invalid."; next; goto GM_Menu; } else set .@charid,0; input .@package,1,.PackageCount; next; mes "[Item Rewards]"; mes "Player: ^B041FF" + .@name$ + "^000000"; mes "Package: ^B041FF#" + .@package + "^000000"; mes " "; mes "Are you sure?"; if (select("Yes:No") == 2) { mes "Request cancelled."; next; goto GM_Menu; } setarray $gm_name_reward$[getarraysize($gm_name_reward$)], strcharinfo(0); setarray $itemreward$[getarraysize($itemreward$)],.@name$,.@package; message .@name$,"[You have a reward pending. See the Item Rewards NPC.]"; if ($itemlog) { if (getarraysize($itemlog1$) > 127) { deletearray $itemlog1$[0],1; deletearray $itemlog2$[0],1; } setarray $itemlog1$[getarraysize($itemlog1$)],strcharinfo(0); setarray $itemlog2$[getarraysize($itemlog2$)],.@name$; } mes "Reward added."; next; goto GM_Menu; case 4: mes "[Item Rewards]"; if (getgmlevel() < .GMDelete) { mes "You are not permitted to delete entries."; next; goto GM_Menu; } mes "Input a name to cancel a reward."; input .@name$; set .@i,0; while (.@i < getarraysize($itemreward$)) { if ($itemreward$[.@i] == .@name$) { deletearray $itemreward$[.@i],2; deletearray $gm_name_reward$[.@i],1; mes "Name cleared."; next; goto GM_Menu; } set .@i, .@i+2; } mes "The name is invalid."; next; goto GM_Menu; case 5: mes "[Item Rewards]"; if (getgmlevel() < .GMDelete) { mes "You are not permitted to delete entries."; next; goto GM_Menu; } mes "^FF0000This action cannot be undone.^000000"; mes "Are you sure?"; mes " "; if (select("Yes:No") == 2) { mes "Request cancelled."; next; goto GM_Menu; } deletearray $itemreward$[0],getarraysize($itemreward$); deletearray $gm_name_reward$[0],getarraysize($gm_name_reward$); mes "All entries cleared."; next; goto GM_Menu; case 6: Log_Menu: mes "[Item Rewards]"; if (getgmlevel() < .GMLogging) { mes "You are not permitted to manage logs."; next; goto GM_Menu; } mes "Logs are currently "+(($itemlog)?"^00D900enabled^000000":"^FF0000disabled^000000")+"."; next; switch(select(" ~ ^55AAFFView Logs^000000: ~ "+((!$itemlog)?"^00D900Enable":"^777777Disable")+" logging^000000: ~ ^DE0000Delete all logs^000000: ~ [Go back]")) { case 1: mes "[Item Rewards]"; mes "Used space: ^F52887" + (getarraysize($itemlog1$)) + "^000000/128"; mes "--------------------------------"; set .@i,0; while (.@i < getarraysize($itemlog1$)) { mes "^B041FF" + $itemlog1$[.@i] + "^000000: sent to ^55AAFF" + $itemlog2$[.@i] + "^000000"; set .@i, .@i+1; } next; goto Log_Menu; case 2: set $itemlog, ((!$itemlog)?1:0); goto Log_Menu; case 3: mes "[Item Rewards]"; mes "^FF0000This action cannot be undone.^000000"; mes "Are you sure?"; mes " "; if (select("Yes:No") == 2) { mes "Request cancelled."; next; goto Log_Menu; } deletearray $itemlog1$[0],getarraysize($itemlog1$); deletearray $itemlog2$[0],getarraysize($itemlog2$); mes "Logs cleared."; next; goto Log_Menu; case 4: next; goto GM_Menu; } case 7: close; } }
  5. strnpcinfo(3)+"::OnMobDead"; should be strnpcinfo(3)+"::OnPoringDead"; according to your script
  6. Maybe you mean 1 random item in the list of randoms items by default ? prontera,155,181,5 script Lotti Girl 100,{ mes "[Lotti Girl]"; mes "It costs "+ .cost[1] +"x "+ getitemname( .cost[0] ) +" to play."; mes " "; for ( .@i = 0; .@i < 20; .@i++ ) mes $lotti_girl_ladder$[.@i]; if ( countitem( .cost[0] ) < .cost[1] ) close; next; if ( select( "Deal me in!", "No way..." ) == 2 ) close; mes "[Lotti Girl]"; while (1) { callsub L_default; mes "Here we go..."; delitem .cost[0], .cost[1]; .@rand = rand(.totalchance); .@r = 0; // <-- think you forgot to put this while ( ( .@rand = .@rand - getd( ".p"+ .@r +"[0]" ) ) >= 0 ) .@r++; .@size = getarraysize( getd(".p"+ .@r ) ); for ( .@i = 1; .@i < .@size; .@i += 2 ) getitem getd( ".p"+ .@r +"["+ .@i +"]" ), getd( ".p"+ .@r +"["+( .@i +1 )+"]" ); if ( getd( ".p"+ .@r +"[0]" ) < 50 ) // announce if below 50% chance announce "Congratulations to "+strcharinfo(0)+" for getting "+ .ann$[.@r] +"!", 0; if ( getd( ".p"+ .@r +"[0]" ) < 10 ) { // score the ladder if below 10% chance copyarray $lotti_girl_ladder$[1], $lotti_girl_ladder$[0], 19; $lotti_girl_ladder$ = strcharinfo(0) +" gains "+ .ann$[.@r] +" at "+ gettimestr( "%d/%m/%Y %H:%M %p", 21 ); } mes " "; mes "wanna try again ?"; next; if ( select( "Yes", "No" ) == 2 ) close; mes "[Lotti Girl]"; if ( countitem( .cost[0] ) < .cost[1] ) { mes "it seems you have ran out of "+ getitemname( .cost[0] ); close; } } close; OnInit: // setarray .p1, 70, 501,25; // debugging ... // setarray .p2, 70, 502,1; // setarray .p3, 40, 503,1; // setarray .p4, 40, 504,1; // setarray .p5, 40, 505,1; // setarray .p6, 50, 506,1, 507,1, 508,1, 509,1; // setarray .p7, 25, 512,1; // setarray .p8, 5, 513,1; setarray .p1, 70, 607,25; setarray .p2, 70, 13710,1; setarray .p3, 40, 5471,1; setarray .p4, 40, 5210,1; setarray .p5, 40, 5224,1; setarray .p6, 50, 2357,1, 2524,1, 2421,1, 2115,1; setarray .p7, 25, 2701,1; setarray .p8, 5, 2394,1; callsub L_default; setarray .cost, 7227,300; .total = 9; freeloop 1; .@i = 1; while ( .@i <= .total ) { .totalchance = .totalchance + getd(".p"+ .@i ); .@j = 1; .@size = getarraysize( getd(".p"+ .@i ) ); while ( .@j < .@size ) { .ann$[.@i] = .ann$[.@i] + getd( ".p"+ .@i +"["+( .@j +1 )+"]" ) +"x "+ getitemname( getd( ".p"+ .@i +"["+ .@j +"]" ) ) +( ( .@j == .@size -2 )? "":"," ); // I think Euphy forgotten to make announcement when configuration has set more than 1 items .@j += 2; } .@i++; } freeloop 0; end; L_default: deletearray .p9; setarray .p9, 30+30+60+60+60+50+75+95, callfunc( "F_RandMes", 5, 12214,502,503,504,505 ),1; // default ... the chance are added up by 100-n% return; } List of randoms items callfunc( "F_RandMes", 5, 12214,502,503,504,505 )// count, item ID, item ID..
  7. Use the proper tab prontera,150,150,5%tab%script%tab%Server Time%tab%100,{
  8. - script Warper_ -1,{ function Disp; function Pick; .@gid = getcharid(2); while( .@i < .size_guild && .guild_id[.@i] != .@gid ) .@i++; if( .@i == .size_guild ) end; menu "Guild Dungeons",GD; // ------------------- Functions ------------------- // ~ Array @c[] holds all (x,y) coordinates. // ~ Use @c[2] EXCEPT when maps begin dynamically // at 0: use @c[0] and Pick() offset 1. // -------------------------------------------------- function Disp { set @menu$,""; if(getarg(0)=="") { set @menu$,getarg(1); return; } for(set .@i,getarg(1); .@i<=getarg(2); set .@i,.@i+1) set @menu$, @menu$+getarg(0)+" "+.@i+":"; return; } function Pick { if(getarg(0)=="") { set .@i, select(@menu$); warp getarg(.@i),@c[.@i*2],@c[.@i*2+1]; } else { set .@i, select(@menu$)-getarg(1,0); warp getarg(0)+((.@i<10)?"0":"")+.@i,@c[.@i*2],@c[.@i*2+1]; } getmapxy(lastwarp$,lastwarpx,lastwarpy,0); close; } GD: setarray @c[2],119,93,39,161,50,44,116,45,199,195,200,124; Disp("","Baldur:Luina:Valkyrie:Britoniah:Arunafeltz:Schwaltzvalt"); Pick("","gld_dun01","gld_dun02","gld_dun03","gld_dun04","arug_dun01","schg_dun01"); OnAgitEnd: OnAgitEnd2: OnInit: sleep 2; deletearray .guild_id; .size_guild = query_sql( "SELECT `guild_id` FROM `guild_castle` WHERE `guild_id` != 0", .guild_id ); end; } prontera,159,192,4 duplicate(Warper_) Warper#1_ 811
  9. Search at the end set .ThirdClass,1; // Enable third classes? (1: yes / 0: no) The code is already in the previous script
  10. The topic was quite interesting so I also wanted to try for fun that's all I didn't want to hurt you or anything
  11. No offense to Skorm but his script consume too much permanent variable for me - script view_map -1,{ OnInit: .size_name = query_sql( "SELECT `name` FROM `char` WHERE `online` = 1 LIMIT 128", .name$ ); end; OnPCLoginEvent: .name$[ .size_name ] = strcharinfo(0);// max 128 players .size_name++; OnEventView: .@name_self$ = strcharinfo(0); sleep2 2; while( playerattached() && @item_equipped ) { .@map_self$ = strcharinfo(3); for( .@i = 0; .@i < .size_name; .@i++ ) { if( .name$[ .@i ] != .@name_self$ ) { getmapxy .@map$, .@x, .@y, 0, .name$[ .@i ]; if( .@map$ == .@map_self$ ) { .@size_tmp++; viewpoint 1, .@x, .@y, .@size_tmp, 0xFF0000; } } } sleep2 2000; for( .@i = 1; .@i < .@size_tmp +1; .@i++ ) viewpoint 2, 0, 0, .@i, 0xFF0000; .@size_tmp = 0; } end; OnPCLogoutEvent: while( .@i < .size_name && .name$[ .@i ] != strcharinfo(0) ) .@i++; if( .@i == .size_name ) end; deletearray .name$[ .@i ], 1; .size_name--; end; } Item sample - must be equipped 2201,Sunglasses,Sunglasses,5,5000,,100,,0,,0,0xFFFFFFFF,7,2,512,,0,0,12,{ doevent "view_map::OnEventView"; },{ set @item_equipped, 1; },{ set @item_equipped, 0; }
  12. quiz_02,171,343,5 duplicate(Exit#1) Exit#02 451 You made a duplicate of the npc where you put OnPCKillEvent: if( strcharinfo(3) == "cell_game" ) { #Cell_Game_Points = #Cell_Game_Points + 3; dispbottom "You get 3 points. Total: "+ #Cell_Game_Points +" points."; attachrid( killedrid ); if( #Cell_Game_Points ) #Cell_Game_Points = #Cell_Game_Points - 1; dispbottom "You lose 1 point. Total: "+ #Cell_Game_Points +" points."; warp strcharinfo(3),0,0; sleep2 10; percentheal 100,100; } end; So the points are duplicated too Put it in another npc
  13. W_Disable: setcell "guild_vs3",19,44,19,55,cell_walkable,1; setcell "guild_vs3",18,44,18,55,cell_walkable,1; setcell "guild_vs3",80,55,80,44,cell_walkable,1; setcell "guild_vs3",81,44,81,55,cell_walkable,1; for( .@i = 5; .@i > 0; .@i-- ) { mapannounce "guild_vs3","Ready ON "+ .@i,0; sleep2 1000; } for( .@i = 1; .@i < 25; .@i++ ) disablenpc "WALL#"+ .@i; disablenpc "Arena Buffer#1"; disablenpc "Arena Buffer#2"; mapannounce "guild_vs3","Walls are now Disabled.",0; mapannounce "guild_vs3","Events STARTS GO GO GO.",0; pvpon "guild_vs3"; if( playerattached() ) close; end;
  14. - script Sample -1,{ OnInit: bindatcmd "dailyreward",strnpcinfo(3)+"::OnAtCommand"; end; OnAtCommand: .@day = atoi( gettimestr("%Y%m%d",19) ); if( #dailyreward == .@day ){ message strcharinfo(0),"You have take the item for today."; }else if( @online > gettimetick(2) ){ message strcharinfo(0),"You must wait 24 hours before receiving more items."; }else{ #dailyreward = .@day; getitem 607,1; message strcharinfo(0),"You gained the item for today."; } end; OnPCLoginEvent: @online = 3600 + gettimetick(2); end; }
  15. Replace getequippercentrefinery(.@part) > rand(100) by getequippercentrefinery(.@part) >= 0 case 1: callsub S_RefineValidate,1,7620,50,.@part; break; case 2: callsub S_RefineValidate,2,7620,200,.@part; break; case 3: callsub S_RefineValidate,3,7620,5000,.@part; break; case 4: callsub S_RefineValidate,4,7620,20000,.@part; break; default: callsub S_RefineValidate,0,7619,2000,.@part; break; The column before .@part is the cost in zeny (ie 50 in the 1st line, 200 in the second..)
  16. http://lmgtfy.com/?q=lms+event+eathena Second link
  17. doc/script_commands.txt *waitingroom "<chatroom name>",<limit>{,<event label>,<trigger>,<required zeny>,<min lvl>,<max lvl>}; This command will create a chat room, owned by the NPC object running this script and displayed above the NPC sprite. The maximum length of a chat room name is 60 letters. The limit is the maximum number of people allowed to enter the chat room. The attached NPC is included in this count. If the optional event and trigger parameters are given, the event label ("<NPC object name>::<label name>") will be invoked as if with a 'doevent' upon the number of people in the chat room reaching the given triggering amount. // The NPC will just show a box above its head that says "Hello World", clicking // it will do nothing, since the limit is zero. waitingroom "Hello World",0; // The NPC will have a box above its head, it will say "Disco - Waiting Room" // and will have 8 waiting slots. Clicking this will enter the chat room, where // the player will be able to wait until 7 players accumulate. Once this happens, // it will cause the NPC "Bouncer" run the label "OnStart". waitingroom "Disco - Waiting Room",8,"Bouncer::OnStart",7; // The NPC will have a box above its head, it will say "Party - Waiting Room" // and will have 8 waiting slots. Clicking this will allow a player who has // 5000 zeny and lvl 50~99 to enter the chat room, where the player will be // able to wait until 7 players accumulate. Once this happens, it will cause // the NPC "Bouncer" run the label "OnStart". waitingroom "Party - Waiting Room",8,"Bouncer::OnStart",7,5000,50,99; Creating a waiting room does not stop the execution of the script and it will continue to the next line. For more examples see the 2-1 and 2-2 job quest scripts which make extensive use of waiting rooms.
  18. Yes only one of them get an item if they have the same ip Sorry I don't know other way than check the ip to prevent dual client with script commands
  19. - script #sample -1,{ OnNPCKillEvent: if (killedrid == 2200 || killedrid == 2201) { set .@map$, strcharinfo(3); getpartymember getcharid(1),2; for (set .@i,0; .@i<$@partymembercount; set .@i,.@i+1) { if ( attachrid($@partymemberaid[.@i]) && !compare( .@ip$,getcharip( $@partymemberaid[.@i] ) ) ) { .@ip$ = .@ip$ +"|"+ getcharip();// !! config 15 players max in the party if (strcharinfo(3) == .@map$ && Hp > 0) getitem 607,1; detachrid; } } } end; } + prevent dual account from getting more than 1 item
  20. Your NPC mc1 try to create a waitingroom but it has already one so your server display a warning In this npc, search waitingroom and
  21. You get wrong. It doesn't prevent dual client, it prevents multi char from the same account in the same party to get multi items
  22. i dont think this is needed....it's impossible for you to login 2 characters within the same account at the same times. so, i believe this part can be skipped. It's possible to invite 2 characters of the same account in the same party, sure both of them can't be online at the same time So the script attachrid the same account id twice
  23. Be more specific and improve your request it will increase your chance to get a response that may solve your request
  24. setbgid is a custom command made by AnnieRuru Topic
×
×
  • Create New...