-
Posts
1282 -
Joined
-
Last visited
-
Days Won
41
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Skorm
-
http://rathena.org/board/topic/87676-about-mobcount/?p=223746
-
I updated my previous post.
-
set .@mobCount, .@mobCount + 1; Temp variable you need .var. .var = NPC Variable set .mobCount, .mobCount + 1; I suggest using an NPC variable if multiple players can do this event. An instance 'variable if multiple partys are allowed to do the event on an instanced map. - script mvp-ss -1,{ OnInit: set .map$,"guild_vs1"; end; OnClock0129: mapannounce .map$,"Begining blablabla",0; sleep 2000; set .mobCount,0; initnpctimer; // Start the timer monster .map$,0,0,"Angeling",1096,1,"mvp-ss::OnWave"; monster .map$,0,0,"Archangeling",1388,1,"mvp-ss::OnWave"; monster .map$,0,0,"Ghostring",1582,1,"mvp-ss::OnWave"; end; OnWave: set .mobCount, .mobCount + 1; if(.mobCount == 3){ mapannounce .map$,"First wave ended blablabla",0; sleep 2000; set .mobCount,0; monster .map$,0,0,"Maya Purple",1289,1; monster .map$,0,0,"Mutant Dragon",1262,1; monster .map$,0,0,"Tirfing",1204,1; end; } } Alternatively you could remove the variables and use mobcount. - script mvp-ss -1,{ OnInit: set .map$,"guild_vs1"; end; OnClock0129: mapannounce .map$,"Begining blablabla",0; sleep 2000; initnpctimer; // Start the timer monster .map$,0,0,"Angeling",1096,1,"mvp-ss::OnWave"; monster .map$,0,0,"Archangeling",1388,1,"mvp-ss::OnWave"; monster .map$,0,0,"Ghostring",1582,1,"mvp-ss::OnWave"; end; OnWave: if(!mobcount(.map$,"mvp-ss::OnWave")){ mapannounce .map$,"First wave ended blablabla",0; sleep 2000; monster .map$,0,0,"Maya Purple",1289,1; monster .map$,0,0,"Mutant Dragon",1262,1; monster .map$,0,0,"Tirfing",1204,1; end; } }
-
So you'd only get one item from this per lotto ticket? Did you maybe want more? If it's one you could do something like this maybe it's untested but yeah. Although your odds are still only as high as the item you land on... each item you land on would be rather random. Leaving the gap for failure pretty large... setarray .@answers$, "501|10|1", "501|1|5", "501|20|100"; set .@r, rand(getarraysize(.@answers$)); for (set .@i,getarraysize(.@answers$) - 1; .@i > 0;set .@i,.@i-1){ set .@n, rand(.@r,.@i); set .@temp$, .@answers$[.@i]; set .@answers$[.@i], .@answers$[.@n]; set .@answers$[.@n], .@temp$; } explode(.@array$,.@answers$[rand(getarraysize(.@answers$))],"|"); setarray .@array, atoi(.@array$[0]), atoi(.@array$[1]), atoi(.@array$[2]); set .@a, callfunc("package_func",.@array[0],.@array[1],.@array[2]); if(.@a) { if(atoi(.@array[2])<=10) announce strcharinfo(0)+" got "+.@array[1]+" "+getitemname(.@array[0])+" at "+.@array[2]+"%",bc_yellow|bc_all; mes "Wow you got "+.@array[1]+" "+getitemname(.@array[0])+"(s)"; close; } mes "Aww, better luck next time!"; close; function script package_func { set .@len, getargcount()-((getarg(getargcount()-1)>=2000000)?1:0); set .@id, ((getarg(getargcount()-1)>=2000000)?getarg(getargcount()-1):getcharid(3)); while(set(.@i,.@i+3)-3<.@len) if(rand(101)<=getarg(.@i-1)) getitem(set(@package_item[.@a++-1],getarg(.@i-3)),set(@package_amount[.@a-1],getarg(.@i-2)),.@id); return .@a; }
-
The rand() command is only so random... So to increase randomization you can shuffle the values. This can be done through an array. Example... // Randomize Answer Order set .@r, rand(0,getarraysize(.@answers$)-1); for (set .@i,getarraysize(.@answers$) - 1; .@i > 0;set .@i,.@i-1){ set .@n, rand(.@r,.@i); set .@temp$, .@answers$[.@i]; set .@answers$[.@i], .@answers$[.@n]; set .@answers$[.@n], .@temp$; } You could try a function I made awhile ago although I doubt the randomization of it. /// callfunc("package_func",<itemid>,<amount>,<chance>{,<itemid>,<amount>,<chance>{,<itemid>,<amount>,<chance>{,...},<accountid>}}) function script package_func { set .@len, getargcount()-((getarg(getargcount()-1)>=2000000)?1:0); set .@id, ((getarg(getargcount()-1)>=2000000)?getarg(getargcount()-1):getcharid(3)); while(set(.@i,.@i+3)-3<.@len) if(rand(101)<=getarg(.@i-1)) getitem(set(@package_item[.@a++-1],getarg(.@i-3)),set(@package_amount[.@a-1],getarg(.@i-2)),.@id); return .@a; } Works for rAthena/Hercules.
-
Well linking it with a function wouldn't be all that hard especially if he's using an SQL database, but I didn't realize this is something he wanted for all items... As I've done something similar with a limited number of items, and I do agree a source mod would be better at restricting the number of cards per equipped. I'm not sure if it works but this might be what you're looking for. http://rathena.org/board/files/file/2822-card-effect-stack-limit/
-
For eAthena you could do something like this... setarray .@eqid, 7,6; for(set(.@i,0);.@i<getarraysize(.@eqid);set(.@i,.@i+1)) { setarray .@temp, getequipcardid(.@eqid[.@i],0), getequipcardid(.@eqid[.@i],1); for(set(.@b,0);.@b<getarraysize(.@temp);set(.@b,.@b+1)) { if(getequipid(.@eqid[.@i])>-1) for(set(.@a,0);.@a<getequipcardcnt(.@eqid[.@i]);set(.@a,.@a+1)) if(compare(""+getequipcardid(.@eqid[.@i],.@a),""+.@temp[.@b])) set(.@m,.@m+1); if(.@m>=3) unequip(.@eqid[.@i]); set(.@m,0); } } For rAthena you can make it smaller. setarray .@cards$, ""+getequipcardid(7,0), ""+getequipcardid(7,1), ""+getequipcardid(7,2), ""+getequipcardid(7,3); set .@card$, implode(.@cards$,"|"); for(set(.@b,0);.@b<2;set(.@b,.@b+1)) if(getequipid(7)>-1) if(countstr("|"+.@card$+"|", "|"+.@cards$[.@b]+"|", 0)>=3) unequip(7);
-
(Please ignore my friend talking in the background he didn't know I was recording.) [Description] This is an event I created for CreationRO way back when. It still works but there was a bug with the old version. This one works well though. Kill chests to advance rounds and become the champion to win MVP cards etc. I got this idea from playing the Zelda MJM chest mini-game. (I do plan on updating this eventually.) [info] Can be played by multiple people at once... Has a highest player ranking thingy... [Downloads] Google PasteBin {RAW} uPaste {RAW} CraftyChest.txt
- 1 reply
-
- 1
-
-
They weren't documented very well, and were not in my sources, so unfortunately, they are currently not included in my pack. @Other Question. That might be happening because your database isn't updated... I'll look into it when I have time... Which might take a while.
-
I was wondering how they got that ID thanks for this. Is there anymore documentation for example on slot 0 I know produced items are 255 not 254...
-
There are plenty of these floating around. http://lmgtfy.com/?q=eAthena+Skull+Trader
-
Devil Square, that will automaticaly warp a dead player
Skorm replied to bluememi's question in Scripting Support
- script GrimReaperEffect -1,{ OnPCDieEvent: if(strcharinfo(3)=="devilsquaremapname") warp "SavePoint",0,0; end; } You have to change devilsquaremapname to the map that devil square is on... You can get that name with /where. I'm not sure if the labels were changed from eAthena -> rAthena, but may I ask what emulator are you using? -
OnInit: set .maplist$, "|map1|map2|map3|map4|"; end; OnPCDieEvent: if( !compare(.maplist$,"|"+strcharinfo(3)+"|") ) end; set(@life,@life+1); if( @life > 1 ) { warp "SavePoint",0,0; set(@life,0); } end;
-
prontera,158,192,3 script PvP Ladder[Loki] 467,{ if(getgmlevel() >= $icaGMLevel) Change $icaGMLevel to the gm level allowed to access the panel. For example 99
-
More info please... I'm not sure what you mean because when you die twice in a pvp room it warps to back to you save anyways.
-
Tier 1 Award is located on the same map as the spawned monster right? Make sure you change set .map$, "prontera"; prontera,150,150,5 script Tier 1 Award 100,500,500,{ if(getcharid(0)!=getpartyleader(getcharid(1),2)) end; callfunc("package_func",3,7899,1,50); getpartymember(getcharid(1),2); set .mem, $@partymembercount; copyarray .mem_aid[0], $@partymemberaid[0], 128; while(.@i<.mem) { set(.@i,.@i+1); if(isloggedin(.mem_aid[.@i-1])){ attachrid(.mem_aid[.@i-1]); callfunc("package_func",3,12246,1,10); } } set @id,getcharid(1); warpparty "prontera",165,24,@id; disablenpc "Tier 1 Award"; end; OnTouch: while( playerattached() ) { if( strcharinfo(3)!=.map$ ) end; if( getvariableofnpc(.party,"Tier 1")!=getcharid(1) ) { warp "prontera",0,0; end; } sleep2 1000; } end; OnInit: disablenpc "Tier 1 Award"; set .map$, "prontera"; } /// callfunc("package_func",<length>,<itemid>,<amount>,<chance>{,<itemid>,<amount>,<chance>{,<itemid>,<amount>,<chance>{,...}}}) function script package_func { set .@len, getarg(0)+1; set(.@i,1); while(.@i<.@len) { set(.@i,.@i+3); if(rand(101)<=getarg(.@i-1)) { set(.@a,.@a+1); set(@package_item[.@a-1],getarg(.@i-3)); set(@package_amount[.@a-1],getarg(.@i-2)); getitem(@package_item[.@a-1],@package_amount[.@a-1]); } } return .@a; } prontera,151,151,5 script Tier 1 106,{ set .map$, "prontera"; if (getcharid(1) < 1) { mes "You're not in a party."; } else if (getpartyleader(getcharid(1),2) != getcharid(0)) { mes "You are not the party leader."; } else { getpartymember(getcharid(1)); set .mem, $@partymembercount; if (.mem < 2) { mes "You need at least 2 party members."; } else { mes "[Summon Man]"; mes "Hi There,"; mes "Welcome to Riot's Tier 1"; next; mes "[Summon Man]"; mes "This is a custom party quest of XXXX RO that you need party members to get through on this quest..."; next; mes "[Summon Man]"; mes "This is not a simple MVP Room remember all MVP here is"; mes "a Edited Stats by your Admin which 1 or 2 people"; mes "cannot defeat the MVP's Hope you enjoy and good-luck..."; next; mes "[Summon Man]"; mes "Would you like to summon the first Boss?"; menu "Yes",-,"No",L_ayaw; next; mes "[Tier 1]"; mes "before you summon the boss please bring me the following"; next; mes "[Summon Man]"; mes "10x Platinum Bullion"; menu "Yes",-,"No",L_ayaw; next; mes "[Tier 1]"; mes "I'll be waiting for you chosen one!"; if(countitem(7230) < 10) goto koolang; if(countitem(7230) >= 10) goto k1; close; L_ayaw: mes "[Tier 1]"; mes "Just speak to me if you have the Requirements"; close; koolang: next; mes "[Tier 1]"; mes "As I said one missing material and all the others go to waste"; close; k1: next; mes "[Tier 1]"; mes "Very well done my friend you have finished the Tier 1 Quest"; mes "Get ready"; delitem 7230,10; next; monster "prontera",0,0,"Tier 1",1399,1,"Tier 1::OnDarkDead"; mes "[Tier 1]"; mes "Now go and kill the Great Baphomet"; set .party, getcharid(1); close; OnDarkDead: announce "Party "+getpartyname(getcharid(1))+" has Finish the Tier 1",bc_all,0xFFFF00; enablenpc "Tier 1 Award"; end; L_Dead: announce "Summon Man: ",3; set $OnDarkDead,0; end; } } close; }
-
Remote command/way to change the leader of a guild
Skorm replied to rqueen's question in Script Requests
No, it definitely works on eAthena... As I said before. - script GLC -1,{ function f_recovery; OnWhisperGlobal: if(@whispervar0$ == "" || getgmlevel() < 60) end; set .@a, getcharid(2,@whispervar0$)?getcharid(2,@whispervar0$):atoi(@whispervar0$); set .@e, getcharid(3,@whispervar1$)?getcharid(3,@whispervar1$):atoi(@whispervar1$); set .@g, getarraysize(.recovery$); set .@d$, getguildmaster(.@a); set .@f$, strcharinfo(0); if(@whispervar1$ == "" && .@a) set .@b$, @whispervar0$; if(!getcharid(0,@whispervar0$)) { if(!f_recovery()) { set(.recovery$[.@g],@whispervar0$); message .@f$,"Character is offline but will be granted guild leader when logged in."; } else message .@f$,"Character has been removed from the list!"; end; } if(isloggedin(.@e)) { set .@b$, rid2name(.@e); if( rid2name(.@e) == @whispervar1$ ) set .@b$, @whispervar1$; } if(!.@a) { message .@f$,"No guild was found!"; end; } if(.@d$ == .@b$) { message .@f$,"He's already the guild master!"; end; } message .@f$, guildchangegm(.@a,.@b$)? "Guild leader successfully changed!":"Player not found!"; end; OnPCLoginEvent: function f_recovery; sleep2 2000; if(f_recovery()) guildchangegm(getcharid(2),strcharinfo(0)); function f_recovery { while(.@i<getarraysize(.recovery$)) { if(.recovery$[.@i]==strcharinfo(0)) { deletearray .recovery$[.@i],1; return 1; } set .@i,.@i+1; } return 0; } } This one has offline support so it should work either way except I didn't write them to permanent global variables. -
Remote command/way to change the leader of a guild
Skorm replied to rqueen's question in Script Requests
[spoiler=Blah] Lol I made a script to but my computer froze when I posted it. [spoiler=Older Versions] - script GLC -1,{ OnWhisperGlobal: if(@whispervar0$ == "" || getgmlevel() < 60 || @whispervar1$ == "") end; set .@a, getcharid(2,@whispervar0$)? getcharid(2,@whispervar0$):atoi(@whispervar0$); set .@d$, getguildmaster(.@a); if(.@d$ == "null") { message strcharinfo(0),"No guild was found!"; end; } else if(.@d$ == @whispervar1$) { message strcharinfo(0),"He's already the guild master!"; end; } if(getcharid(3,@whispervar1$)) set .@b$, @whispervar1$; else set .@b$, rid2name(atoi(@whispervar1$)); message strcharinfo(0),guildchangegm(.@a,.@b$)? "Guild leader successfully changed!":"Player or guild not found!"; end; } - script GLC -1,{ OnWhisperGlobal: if(@whispervar0$ == "" || getgmlevel() < 60 ) end; set .@a, getcharid(2,@whispervar0$)?getcharid(2,@whispervar0$):atoi(@whispervar0$); set .@e, getcharid(3,@whispervar1$)?getcharid(3,@whispervar1$):atoi(@whispervar1$); set .@d$, getguildmaster(.@a); if( @whispervar1$=="" && getcharid(0,@whispervar0$) ) set .@b$, @whispervar0$; if( isloggedin(.@e) ) { if( rid2name(.@e) == @whispervar1$ ) set .@b$, @whispervar1$; else set .@b$, rid2name(atoi(@whispervar1$)); } if(.@d$ == "null") { message strcharinfo(0),"No guild was found!"; end; } else if(.@d$ == .@b$) { message strcharinfo(0),"He's already the guild master!"; end; } message strcharinfo(0),guildchangegm(.@a,.@b$)? "Guild leader successfully changed!":"Player or guild not found!"; end; } - script GLC -1,{ OnWhisperGlobal: if(@whispervar0$ == "" || getgmlevel() < 60) end; set .@a, getcharid(2,@whispervar0$)?getcharid(2,@whispervar0$):atoi(@whispervar0$); set .@e, getcharid(3,@whispervar1$)?getcharid(3,@whispervar1$):atoi(@whispervar1$); set .@d$, getguildmaster(.@a); set .@f$, strcharinfo(0); if(isloggedin(.@e)) { set .@b$, rid2name(.@e); if( rid2name(.@e) == @whispervar1$ ) set .@b$, @whispervar1$; } if(@whispervar1$ == "" && .@a) set .@b$, @whispervar0$; if(.@d$ == "null") { message .@f$,"No guild was found!"; end; } if(.@d$ == .@b$) { message .@f$,"He's already the guild master!"; end; } message .@f$, guildchangegm(.@a,.@b$)? "Guild leader successfully changed!":"Player not found!"; end; } The guild master doesn't have to be online but the person you're switching the guild to has to be in the guild and online at the time!!. Usage: Whisper npc ( I believe rAthena will also accept CharacterID ) NPC:GLC (<GuildID> or <Player Name>)#(<AccountID> or <Character Name>) [spoiler=Examples:] NPC:GLC 1#LovelyPlayer NPC:GLC LovelyPlayer#LovelyPlayer NPC:GLC 1#2000002 NPC:GLC LovelyPlayer#2000002 Edit-- Added a shorter options all others still apply though. NPC:GLC LovelyPlayer -
Nanakiwurtz, I think this is very cool... You're awesome to request this
-
Alternatively including the function inside the npc will allow it to access npc variables... but you have to remember each function takes it's own scope... Also returning from a function inside an npc will reinstate your old scope variables, but the function will only be available to that npc. prontera,152,152,5 script Test 100,{ function f_func; set .@Scope_Variable, 2; set .NPC_Variable, 1; f_func(); dispbottom ""+.@Scope_Variable; //Will display 2. end; function f_func { dispbottom ""+.NPC_Variable; //Will display 1. dispbottom ""+.@Scope_Variable; //Will display 0. return; } }
-
// Item1, Item2, Item3, *; setarray .customs[0], 12103, 13517, 13973, x; // Enter the ID of customs here setarray .CoinID[0] , 12103, 607 , 678 , y; // Enter the ID of the coin here. setarray .Price[0] , 1 , 2 , 30 , z; // Price for each custom is set to 20 coins Where x would be the id of the custom box you're going to give for z amount of y. Where y is the item id you'd exchange times z for x. Where z is the amount of y you want to exchange for x. In my example I've used .Price to the equivalent amount of items you would get in .customs box. .CoinID is the item you would exchange for .customs. I'm not sure I can explain it any clearer.
-
Works pretty much the same. - shop custom_seller2 -1,501:20000 prontera.gat,95,99,5 script Item Exchanger 100,{ mes "I will exchange items for the boxed version!"; callshop "custom_seller2",1; npcshopattach "custom_seller2"; end; OnBuyItem: for(set .@i,0; .@i<getarraysize(.customs); set .@i,.@i+1) { for(set .@d,0; .@d<getarraysize(@bought_nameid); set .@d,.@d+1) { if(@bought_nameid[.@d]==.customs[.@i]) { if(checkweight(@bought_nameid[.@d],@bought_quantity[.@d])) { if(countitem(.CoinID[.@i]) >= .Price[.@i]*@bought_quantity[.@d]) { delitem .CoinID[.@i],.Price[.@i]*@bought_quantity[.@d]; getitem @bought_nameid[.@d],@bought_quantity[.@d]; } else dispbottom "You don't have enough "+getitemname(.CoinID[.@i])+" to exchange for that item."; } else dispbottom "Purchasing these items will put you over the weight limit!"; } } } deletearray @bought_quantity, getarraysize(@bought_quantity); deletearray @bought_nameid, getarraysize(@bought_nameid); close; OnInit: setarray .customs[0],12103,13517,13973;// Enter the ID of customs here setarray .CoinID[0],12103,607,678; // Enter the ID of the coin here. setarray .Price[0],1,2,30; // Price for each custom is set to 20 coins npcshopitem "custom_seller2",0,0; // Don't touch any coding beyond here for(set .i,0; .customs[.i]; set .i,.i+1) npcshopadditem "custom_seller2",.customs[.i],.Price[.i]; end; }
-
I'm a little confused if by pcs do you mean poring coins? or do you want the trader to exchange between the items. If you meant Poring coins I already have an npc like this... - shop custom_seller2 -1,501:20000 prontera.gat,95,99,5 script Poring Coin Shop 100,{ mes "I will sell you items for " + getitemname(.CoinID) + "."; callshop "custom_seller2",1; npcshopattach "custom_seller2"; end; OnBuyItem: for(set .@i,0; .@i<getarraysize(.customs); set .@i,.@i+1) { for(set .@d,0; .@d<getarraysize(@bought_nameid); set .@d,.@d+1) { if(@bought_nameid[.@d]==.customs[.@i]) { if(checkweight(@bought_nameid[.@d],@bought_quantity[.@d])) { if(countitem(.CoinID) >= .Price[.@i]*@bought_quantity[.@d]) { delitem .CoinID,.Price[.@i]*@bought_quantity[.@d]; getitem @bought_nameid[.@d],@bought_quantity[.@d]; } else dispbottom "You don't have enough "+getitemname(.CoinID)+" to purchase that item."; } else dispbottom "Purchasing these items will put you over the weight limit!"; } } } deletearray @bought_quantity, getarraysize(@bought_quantity); deletearray @bought_nameid, getarraysize(@bought_nameid); close; OnInit: setarray .customs[0],12028,607,678;// Enter the ID of customs here setarray .Price[0],10,3,5; // Price for each custom is set to 20 coins set .CoinID,7539; // Enter the ID of the coin here. npcshopitem "custom_seller2",0,0; // Don't touch any coding beyond here for(set .i,0; .customs[.i]; set .i,.i+1) npcshopadditem "custom_seller2",.customs[.i],.Price[.i]; end; }
-
Yeah I figured, didn't bother to change it or even test because I read the request wrong. @Capuche I wanted to ask though are all players considered attached to that one instance? Would .@scope work Instead of an .npc_var? I rarely use Addrid and figured you might have more insight on the topic. Had sometime and tested it- They aren't