-
Posts
91 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Posts posted by Sehrentos
-
-
One option is to use OnTime events with rand and switch when to start or skip the tick.
To start that event call:
donpcevent "Announcer2::OnGMStart";
-
Hi, You can try if this works for you:
INSERT INTO pvp_ranking (charid,points) VALUES(150013, 0) ON DUPLICATE KEY UPDATE points = CASE WHEN points >= 12 THEN points - 12 ELSE 0 END
Change the table column names to match yours.
- 1
-
Hey, I got some spare time and decided to update the script.
@Musika6988Version 2.9
Added loot modes 10 and 11 with party select option.
And option to turn off the radar (changing monster HP)
Update: Version 2.9.1
Fix random reward will be selected only once, to avoid abuse.
Added option to turn off mapflags.
Added more default .MOB_ status points.
Renamed some values. easier to understand.
Update2: Version 2.9.2
Disabled FOG effect.
Added more announce text.
Added unit checks OnMobDie event.
Added inarray optimizations.
Note: To rename the Treasure Chest NPC, replace ALL "Treasure Chest#wb_" strings but keep the index numbers.
- 1
-
49 minutes ago, Strand said:
Hello @Sehrentos,
Thank you for your time and help but I tried the first one with the arrays and the 2nd party member is not receiving the PvPKills Points in both cases (when enemy does not have the variable "last_kill" and when he does).
Any idea what could be happening?
Hi, save the original killedrid to .@killedrid and use that in the checks like this: https://pastebin.com/nK2XZyGY
Since every party member can have different killedrid.
-
21 minutes ago, Strand said:
Hello @Sehrentos
Sorry for being such a fool. I'm pretty bad with the arrays. Is there any way that you can edit my whole script with your suggestion, just to show the final outcome?
If you were so kind...
Thank you!!
Hi, @Strand
Here are 2 options for you. Pick one that suits for you: https://pastebin.com/x16cxTkb
-
7 hours ago, Strand said:
Where exactly do I add or edit addrid(2, 0, getcharid(1));?
Hi, @Strand
You can use it like this in your script:
set .@map$, strcharinfo(3); addrid(2, 0, .@party_id); if( HP && strcharinfo(3) == .@map$ ) set .@online_count,.@online_count + 1;
Or with the getpartymember & copyarray:
getpartymember .@party_id, 2; .@party_count = $@partymembercount; copyarray .@party_aid[0], $@partymemberaid[0], .@party_count; set .@map$, strcharinfo(3); for( set .@i, 0; .@i < .@party_count; set .@i, .@i +1 ) if( attachrid( .@party_aid[.@i] ) ) if( HP && strcharinfo(3) == .@map$ ) set .@online_count,.@online_count + 1;
And double check {curly brackets}. I think one was set off the course.
-
Hmm, well could it be that the server variables get changed during party member loop and then it fails. You should save the $@ to a .@ instance variable with copyarray, since they can change at any moment when requesting party data.
Or attach all available party members with addrid(2, 0, getcharid(1));
-
On 9/17/2018 at 3:36 AM, Mahiro said:
for(.@i=0; .@i<getarraysize(.@charid); .@i++)
Hey, you can do one extra for loop for the .@guild_id too.
- 1
-
Hey, you can use OnHour event with donpcevent "npcname::OnInit";
-
On 9/16/2018 at 12:22 AM, Elysium said:
.@i = rand(getarraysize(.item));
if( .item[.@i] == .GlobalMessage ) {
announce "Player "+ strcharinfo(0) +" obtaining "+ .qnt[.@i] +" x "+ getitemname(.item[.@i]) +".",0;
}
getitem .item[.@i], .qnt[.@i];
Edit that rand() line?
-
On 8/12/2018 at 2:32 PM, dikapramantya said:
Hi @Sehrentos .
I want to ask how to make it need a kill x global_monster in ragnarok world to trigger this script?
and after kill the world boss, variable will reset to 0?
i've try using OnNPCKillEvent: but when i put in top, the npc not count it . i'm so confused
Hey @dikapramantya
Sorry for the long wait. I have been too busy with other projects.
How you can trigger the Start event. Create new NPC that has OnNPCKillEvent and a counter for the kills and call this when you want to start it:donpcevent "WorldBoss::OnEnable";
Quotesir, im having a problem with the this script. i don't know what to do? please help....... thank you
Hey @ichikun1
I think you must update your server if it does not support "unittalk".
-
1 hour ago, Cydh said:
Updates and folding fixed in https://github.com/Sehrentos/rAthena-syntax-highlight/pull/7
Thank you for the updates!
-
On 28.3.2018 at 10:05 AM, hendra814 said:
set @Esucces, @Esucces+1;
Just for a tip:
For permanent character variable we can use "set Esuccess" instead of "set @Esuccess" or it will reset on logout?
It depends how we want to limit the access.
-
18 hours ago, Leic said:
thanks. how about a script that will delete the current pin code if you entered the warp?
"UPDATE login SET pincode = '' WHERE account_id="+getcharid(3);
-
On 12.3.2018 at 10:14 AM, jawbreaker said:
if (!@inventorylist_bound[.@i]){
.@itemname$ = callfunc( "getitemname2", @inventorylist_id[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i], @inventorylist_bound[.@i]);
.@menu$ = .@menu$ + @itemname2_info$ + .@itemname$ +":";
}
Hmm, add also the empty in the menu so it will be properly skipped and keep the index number:
.@i = 0; while ( .@i < @inventorylist_count ) { /* Filter only items that is not bound */ if (!@inventorylist_bound[.@i]){ .@itemname$ = callfunc( "getitemname2", @inventorylist_id[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i], @inventorylist_bound[.@i]); .@menu$ = .@menu$ + @itemname2_info$ + .@itemname$; } .@menu$ = .@menu$ + ":"; .@i++; } .@s = select(.@menu$) -1;
-
Look for pincode in the login table.
query_sql("SELECT pincode FROM login WHERE account_id="+ getcharid(3) +";", .@pin); if ( getarraysize( .@pin ) ) { /* Has pincode .@pin[0] */ }
-
1 hour ago, Elysium said:
Your the best! waiting for the TODO to make it complete
Thanks,
I have a function ready for the party select menu. Just need some spare time to add it.
Here is a sample of it if you are interested: https://pastebin.com/zRdqbQnu
- 1
-
Thank you for this share.
I would suggest more loot options like:- Reward all near the boss and not just single party.- Selective where leader can select what item to who.And maby multiple events at once, but not in same map.Update: From 2.4 into 2.7 version
Minor text changes.
Added WorldBossRadar event NPC to monitor World Boss HP.
- World Boss HP will increase or decrease by 1.5 mil per each player in 20 cell range and is updated every 10 seconds.
Added timeout timer to clear expired event monster.
Added loot mode 1 give one reward to one random party member.
Added loot modes 4-5 give all/one rewards to all nearby players and their party members.
Added loot modes 6-7 give all/one rewards to all nearby players.
Removed Treasure Chest monster and added Treasure Chest NPC's.
Added multiple events at once, but not in the same map.
Added loot modes 8-9 give all/one rewards to all players in same map.
Added double exp and drop rates for 1 hour after boss is killed. Can be disabled.
TODO: Loot modes select party members.
I will try to update this if i forgot to add something.
- 2
-
Thank you for the full setup!
It's working great
Just added this bat file for accessing the database.
@echo off SET NAME=SingleCore Database Login TITLE %NAME% COLOR 0E .\bin\mysql.exe --defaults-file=my-large.ini -u <username> -p <database> exit
-
3 hours ago, Musika6988 said:
[Error]: buildin_strcharinfo: Player with char id '0' is not found.
Okay, so you put the loop in the wrong place.
Not to worry here is the option 1:
if( prompt( "Distribute Loots", "Dispose Loots" ) == 1 ){ //getpartymember .@party_id, 0; // name getpartymember .@party_id, 1; // cid getpartymember .@party_id, 2; // aid // Copy the temporary party data .@party_size = $@partymembercount; //copyarray .@party_name$[0], $@partymembername$[0], .@party_size; copyarray .@party_cid[0], $@partymembercid[0], .@party_size; copyarray .@party_aid[0], $@partymemberaid[0], .@party_size; // Loop through each reward for( .@i = 0; .@i < @size; .@i++ ){ next; mes "^777777 ~ " + getitemname( @reward[.@i] ) + "^000000"; if( prompt( "Cast Loots" ) == 1 ) { .@rng = rand( .@party_size ); // If they are not online, nothing will happen if( isloggedin( .@party_aid[.@rng], .@party_cid[.@rng] ) ) { //message .@party_name$[.@rng], "Gained " + getitemname( @reward[.@i] ) + " ( Distributed Randomly )"; .@name$ = strcharinfo(0, .@party_cid[.@rng]); message .@name$, "Gained " + getitemname( @reward[.@i] ) + " ( Distributed Randomly )"; getitem @reward[.@i], 1, .@party_aid[.@rng]; // DEBUG <label>Cast Loots!<player>,<reward>,<AID> debugmes .@label$ + " Cast Loots! player= " + .@name$ + ", reward=" + @reward[.@i] + ", aid=" + .@party_aid[.@rng]; } } } }
And this is option 2 which im not 100% sure about:
if( prompt( "Distribute Loots", "Dispose Loots" ) == 1 ){ //getpartymember .@party_id, 0; // name getpartymember .@party_id, 1; // cid getpartymember .@party_id, 2; // aid // Copy the temporary party data .@party_size = $@partymembercount; //copyarray .@party_name$[0], $@partymembername$[0], .@party_size; copyarray .@party_cid[0], $@partymembercid[0], .@party_size; copyarray .@party_aid[0], $@partymemberaid[0], .@party_size; // Loop through each party member .@psize = .@party_size; for( .@i = 0; .@i < .@psize; .@i++ ) { // If they are not online, remove from array if( !isloggedin( .@party_aid[.@i], .@party_cid[.@i] ) ){ deletearray .@party_cid[.@i], 1; deletearray .@party_aid[.@i], 1; .@party_size--; } } // Loop through each reward for( .@i = 0; .@i < @size; .@i++ ){ next; mes "^777777 ~ " + getitemname( @reward[.@i] ) + "^000000"; if( prompt( "Cast Loots" ) == 1 ) { .@rng = rand( .@party_size ); // If they are not online, nothing will happen if( isloggedin( .@party_aid[.@rng], .@party_cid[.@rng] ) ) { //message .@party_name$[.@rng], "Gained " + getitemname( @reward[.@i] ) + " ( Distributed Randomly )"; .@name$ = strcharinfo(0, .@party_cid[.@rng]); message .@name$, "Gained " + getitemname( @reward[.@i] ) + " ( Distributed Randomly )"; getitem @reward[.@i], 1, .@party_aid[.@rng]; // DEBUG <label>Cast Loots!<player>,<reward>,<AID> debugmes .@label$ + " Cast Loots! player= " + .@name$ + ", reward=" + @reward[.@i] + ", aid=" + .@party_aid[.@rng]; } } } }
Update:
Since this thread is marked as complete.
You can PM me about your results and we can continue there, if you need more help with this
-
18 hours ago, Musika6988 said:
The random choice of Tier Reward in this one worked, but stil, it didn't give any prize, it only says "Gained" but no item obtained. and no debug errors on the console..
Okay, there was no online check when distributing random reward. getitem will do nothing if user is offline.
Try this (I commented out the party_name_menu since it's not in use):
OnTalk: .@party_id = getcharid(1); .@map$ = strcharinfo(3); .@label$ = @label$; if( getcharid(0) != getpartyleader( .@party_id,2 ) ){ message strcharinfo(0), "You're not Party Leader."; monster .@map$, rand(.@x,.@x-3), rand(.@y-3,.@y), "--ja--", 1324, 1, .@label$; end; } else { mes "[Loot Distributor]"; mes "Please ensure you distribute the Rewards. If you cancelled this, your party might not able to receive any rewards."; next; mes "Reward List :"; for( .@i = 0; .@i < @size; .@i++ ) mes "^777777 ~ " + getitemname( @reward[.@i] ) + "^000000"; if( prompt( "Distribute Loots", "Dispose Loots" ) == 1 ){ //getpartymember .@party_id, 0; // name getpartymember .@party_id, 1; // cid getpartymember .@party_id, 2; // aid // Copy the temporary party data .@party_size = $@partymembercount; //copyarray .@party_name$[0], $@partymembername$[0], .@party_size; copyarray .@party_cid[0], $@partymembercid[0], .@party_size; copyarray .@party_aid[0], $@partymemberaid[0], .@party_size; // Create party member menu (NOT IN USE!!) //for( .@i = 0; .@i < .@party_size; .@i++ ){ // if( isloggedin( .@party_aid[.@i], .@party_cid[.@i] ) ) // .@party_name_menu$ = .@party_name_menu$ + .@party_name$[.@i]; // .@party_name_menu$ = .@party_name_menu$ + ":"; //} // Loop through each reward for( .@i = 0; .@i < @size; .@i++ ){ next; mes "^777777 ~ " + getitemname( @reward[.@i] ) + "^000000"; if( prompt( "Cast Loots" ) == 1 ) { .@rng = rand( .@party_size ); // If they are not online, nothing will happen if( isloggedin( .@party_aid[.@rng], .@party_cid[.@rng] ) ) { //message .@party_name$[.@rng], "Gained " + getitemname( @reward[.@i] ) + " ( Distributed Randomly )"; .@name$ = strcharinfo(0, .@party_cid[.@rng]); message .@name$, "Gained " + getitemname( @reward[.@i] ) + " ( Distributed Randomly )"; getitem @reward[.@i], 1, .@party_aid[.@rng]; // DEBUG <label>Cast Loots!<player>,<reward>,<AID> debugmes .@label$ + " Cast Loots! player= " + .@name$ + ", reward=" + @reward[.@i] + ", aid=" + .@party_aid[.@rng]; } } } } mes "Congratulations!"; mapannounce .@map$, "All Rewards have been distributed.", 0; end; }
Update: Other way of avoiding offline party members is to modify the party arrays.
Here is a quick sample how to do it (not tested):
// Loop through each party member .@psize = .@party_size; for( .@i = 0; .@i < .@psize; .@i++ ) { // If they are not online, remove from array if( !isloggedin( .@party_aid[.@i], .@party_cid[.@i] ) ){ deletearray .@party_cid[.@i], 1; deletearray .@party_aid[.@i], 1; .@party_size--; } }
This would go after the prompt "Cast Loots".
-
18 hours ago, Musika6988 said:
And no it does not show any error i think?
Does this debug message print in your console and does the reward or party_aid have any value? -This is right after the getitem
debugmes .@label$ + " Cast Loots! reward=" + @reward[.@i] + ", party_aid=" + .@party_aid[.@name];
-
Hey,
One way is to move this:
set #Roll_Claimed,gettimetick(2) + ( .Hours * 3600 );
In to the Item Apear List dialogue before next; like this:
mes "Item Apear List :"; mes "[ ^FF0000Required Items^000000 ] [ ^0000FFItem Gain^000000 ]"; set #Roll_Claimed, gettimetick(2) + ( .Hours * 3600 );
If player cancel the roll, the daily roll will be set anyway. So he can't re-roll ?
-
6 hours ago, Musika6988 said:
bump for this~
Hey
Does your console provide any error messages ?
Can i see your edited version of the file ?
Here is mine:
- script WorldBoss -1,{ OnTalk: .@party_id = getcharid(1); .@map$ = strcharinfo(3); .@label$ = @label$; if( getcharid(0) != getpartyleader( .@party_id,2 ) ){ message strcharinfo(0), "You're not Party Leader."; monster .@map$, rand(.@x,.@x-3), rand(.@y-3,.@y), "--ja--", 1324, 1, .@label$; end; } else { mes "[Loot Distributor]"; mes "Please ensure you distribute the Rewards. If you cancelled this, your party might not able to receive any rewards."; next; mes "Reward List :"; for( .@i = 0; .@i < @size; .@i++ ) mes "^777777 ~ " + getitemname( @reward[.@i] ) + "^000000"; if( prompt( "Distribute Loots", "Dispose Loots" ) == 1 ){ getpartymember .@party_id; getpartymember .@party_id,1; .@party_size = $@partymembercount; copyarray .@party_aid[0], $@partymemberaid[0], .@party_size; copyarray .@party_name$[0], $@partymembername$[0], .@party_size; for( .@i = 0; .@i < $@partymembercount; .@i++ ){ if( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) .@party_name_menu$ = .@party_name_menu$ + $@partymembername$[.@i]; .@party_name_menu$ = .@party_name_menu$ + ":"; } for( .@i = 0; .@i < @size; .@i++ ){ next; mes "^777777 ~ " + getitemname( @reward[.@i] ) + "^000000"; .@name = rand( .@party_size ); if( prompt( "Cast Loots" ) == 1 ) { //.@name = rand( .@party_size ); message .@party_name$[.@name], "Gained " + getitemname( @reward[.@i] ) + " ( Distributed Randomly )"; getitem @reward[.@i], 1, .@party_aid[.@name]; // DEBUG debugmes .@label$ + " Cast Loots! reward=" + @reward[.@i] + ", party_aid=" + .@party_aid[.@name]; } //getitem @reward[.@i],1,.@party_aid[.@name]; } } mes "Congratulations!"; mapannounce .@map$, "All Rewards have been distributed.", 0; end; } OnClock1159: OnClock2359: set .RandMap, rand( getarraysize( .Map$ ) ); set .RandMVP, rand( getarraysize( .MVP ) ); killmonster .Map$, "All"; .@mins = .sleep / 60000; announce "[World Boss] A rift on time and space is about to be opened! A World Boss will appear in " + .@mins + " minute! Prepare your Hunting Party!", bc_all, 0xFF0000; sleep .sleep; monster .Map$[ .RandMap ], 0, 0, "World Boss", .MVP[ .RandMVP ], 1, strnpcinfo(0) + "::OnKilled"; announce "[World Boss] A World Boss " + getmonsterinfo( .MVP[ .RandMVP ], 0 ) + " appeared in " + .Map$[ .RandMap ] + " to wreck havoc!! Form a Hunting Party and stop it!!", bc_all, 0xFF0000; end; OnKilled: .@party_id = getcharid(1); .@party_name$ = getpartyname(.@party_id); .@leader_id = getpartyleader(.@party_id, 2); .@leader_name$ = strcharinfo(0, .@leader_id); announce "[World Boss] The " + .@party_name$ + " Hunting Party killed the World Boss! Congratulations!", bc_all, 0xFF0000; //announce "[World Boss] The "+getpartyname(getcharid(1))+" Hunting Party killed the World Boss! Congratulations!", bc_all, 0xFF0000; getmapxy(.@map$, .@x, .@y, 0); monster .@map$, rand(.@x, .@x-3), rand(.@y-3, .@y), "--ja--", 1324, 1, .npc_name$ + "::OnBoxKill"; end; OnBoxKill: deletearray @reward; @label$ = .npc_name$ + "::OnBoxKill"; //@size = getd( ".tier_reward_"+.tier+"_size" ); //copyarray @reward[0],getd( ".tier_reward_"+.tier+"[0]" ),@size; // Select random tier set from a range 0-3 @range = rand(0, 3); @size = getd( ".tier_reward_" + @range + "_size" ); //@size = getarraysize(getd(".tier_reward_" + @range)); copyarray @reward[0], getd(".tier_reward_" + @range + "[0]"), @size; //doevent "WorldBoss::OnTalk"; doevent .npc_name$ + "::OnTalk"; end; OnInit: // tier reward setarray .tier_reward_0,7227,30804,30805,30806,30000,30001; setarray .tier_reward_1,7227,7227,7227,7227,7227,7227; setarray .tier_reward_2,30804,30804,30804,30804,30804,30804; setarray .tier_reward_3,30805,30805,30805,30805,30805,30805; .tier_reward_0_size = getarraysize( .tier_reward_0 ); .tier_reward_1_size = getarraysize( .tier_reward_1 ); .tier_reward_2_size = getarraysize( .tier_reward_2 ); .tier_reward_3_size = getarraysize( .tier_reward_3 ); setarray .Map$[0],"prontera","morocc","geffen","payon","alberta","aldebaran","xmas","comodo","yuno","amatsu","gonryun","umbala","louyang","ayothaya","eibroch","hugel","rachel","veins","moscovia"; setarray .MVP[0],3165,3166,3167,3169,3175,3177; .sleep = 60000; // 60000ms = 1min .npc_name$ = strnpcinfo(0); setmapflag .map$,mf_partylock; setmapflag .map$,mf_nomobloot; setmapflag .map$,mf_nomvploot; end; }
*debugmes - With this you can see a debug message in your server console.
Extract char_id from crafted items card position 3 & 4
in Scripting Support
Posted · Edited by Sehrentos
Notes
Hello,
Is it possible to calculate and extract the crafted items char_id from card position 3 and 4 ?
I have this test script, where i'm trying to extract as many data from the crafted items as possible and show results.
In docs char_id is calculated: @card3 = @charid & 65535; @card4 = @charid >> 16; when crafting them.
Thanks in advance.