-
Posts
1,238 -
Joined
-
Last visited
-
Days Won
28
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Skorm
-
prontera,100,100,1 script WalkNearMe 100,10,10,{ end; OnTouch: npctalk "Hello world"; end; } It is activated by the presence of the character. The "10,10" after "100," in the NPC header refers to the x and y distance from the NPC with which a character can "bump" into the NPC and trigger the OnTouch: event.
-
Ghost's Scripts [Latest: Ghost's PvP System v1.3]
Skorm replied to Ghost's topic in Script Collections
https://pastebin.com/pX5nFgdp I'll update the original post. -
PMing someone to soliciting sales is against the forums rules and would result in infractions, but someone else contacting you because they've seen your work isn't. So yeah, I don't think this is necessary a bad thing. I'd also like to reiterate that the Graphic Section has had this since 2011. But, I respect your input all the same.
-
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: [email protected] = true; if(inarray(.maps$,strcharinfo(3)) != -1) { for([email protected] = 0; [email protected] < .slotlen; [email protected]++) [email protected] &= !getequipcardcnt(.slots[[email protected]]); if([email protected]) end; for([email protected] = 0; [email protected] < .slotlen; [email protected]++) { if(inarray([email protected],getequipid(.slots[[email protected]])) == -1) { [email protected][getarraysize([email protected])] = getequipid(.slots[[email protected]]); for([email protected] = 0; [email protected] < 4; [email protected]++) { [email protected] = getequipcardid(.slots[[email protected]],[email protected]); if([email protected] >= 4000) { getmapunits(BL_PC,strcharinfo(3),[email protected][0]); // Add player to ongoing list. for([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++) { if(inarray(getd("."+strcharinfo(3)+"_mapusers"), [email protected][[email protected]]) != -1) { setd "."+strcharinfo(3)+"_mapusers["+getarraysize(getd("."+strcharinfo(3)+"_mapusers"))+"]", [email protected][[email protected]]; } } for([email protected] = 0; [email protected] < getarraysize(getd("."+strcharinfo(3)+"_mapusers")); [email protected]++) { // Remove player and item list. if(inarray([email protected], getd("."+strcharinfo(3)+"_mapusers["[email protected]+"]")) != -1) { deletearray "."+strcharinfo(3)+"_"+getd("."+strcharinfo(3)+"_mapusers["[email protected]+"]")+"_mapitems"; deletearray getd("."+strcharinfo(3)+"_mapusers["[email protected]+"]"), 1; } // Searching through lists of map players cards... else if(getcharid(3) != getd("."+strcharinfo(3)+"_mapusers["[email protected]+"]")) { if(inarray(getd("."+strcharinfo(3)+"_"+getd("."+strcharinfo(3)+"_mapusers["[email protected]+"]")+"_mapitems"), [email protected]) != -1) { warp "prontera",0,0; dispbottom "You've been removed from the map because someone else is already using "+getitemname([email protected])+"."; end; } } } // Adding card to the current players list. setd "."+strcharinfo(3)+"_"+getcharid(3)+"_mapitems["+getarraysize(getd("."+strcharinfo(3)+"_"+getcharid(3)+"_mapitems"))+"]", [email protected]; } } } } } 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([email protected] = 0; [email protected] < getarraysize(.maps$); [email protected]++) setmapflag .maps$[[email protected]], mf_loadevent; }
-
[email protected] Is incremented before evaluation. Example: if([email protected] == 1) //True if([email protected]++ == 1) //False
-
Ahh topic title is misleading then.
-
Where does @die not work?
-
I want a place to showcase scripts and mini-games and instances that I've made but not necessary release them. A place that I can get comments and feedback. We have that for graphics things but I think a "Script Showcase" section under scripts could be useful. Thoughts?
-
@worn I think a more practical way to do this would be... https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L6663 - script AllMobDrop -1,{ OnInit: query_sql("SELECT `ID` FROM `mob_db_re` UNION SELECT `ID` FROM `mob_db2_re`;", [email protected]_ids); [email protected] = getarraysize([email protected]_ids); for([email protected] = 0; [email protected] < [email protected]; [email protected]++) { addmonsterdrop [email protected]_ids[[email protected]],501,100; //Red Potion at 1% drop. } end; } or... https://github.com/rathena/rathena/blob/master/doc/item_bonus.txt#L465 - script AllMobDrop -1,{ OnPCLoginEvent: bonus_script "bonus2 bAddMonsterDropItem,501,100;",86400,8,0; //Red Potion at 1% drop for 24 hours. end; }
-
Script request that shows the cards that have already been dropped on the server
Skorm replied to Tdi123's question in Script Requests
Best way I can think of to do this would to be to query the SQL database in player inventories and carts and storage/guild storage and check for the card item id ranges in a distinct fashion. -
Bloody Branch MVP kill announcer & MVP Announcer script
Skorm replied to DEsMOn's question in Script Requests
I think this is a better approach because the latter will still trigger on normal spawning MVPS. Change the Bloody Branch item script to... monster "this",-1,-1,"--ja--",-3,1,"BB_MVP_Announce::OnBBMVPDeath"; And then add this npc... - script BB_MVP_Announce -1,{ OnBBMVPDeath: announce "'"+ strcharinfo(0) +"' has killed ("+ getmonsterinfo(killedrid,MOB_NAME) +").",bc_yellow|bc_all; end; } -
@Deye0823 There are quite a few out there. Many of them are pretty easy to modify and get the results you're looking for. Have you tried this one? Also searching for them on the forums might be your best bet.
-
Yeah just set a npc variable for it. prontera,100,200,3 script Picky 78,{ if(!.one_at_a_time) { .one_at_a_time = 1; mes "Hello"; next; .one_at_a_time = 0; } else { mes "Do you mind I'm talking to someone here!"; } close; } Edit -- I thought about it a little more and this method might not always work for example if a player gets disconnected while talking with the npc and never resets the variable. So instead maybe it would be better to use an npctimer there might still be some conditions where the player leaves the npc and is still attached but I think overall it's a better approach. prontera,100,200,3 script Picky 78,{ if(!.one_at_a_time) { attachnpctimer; initnpctimer; mes "Hello"; next; } else { mes "Do you mind I'm talking to someone here!"; } close; Ontimer0: .one_at_a_time = 1; OnTimer5000: if(getattachedrid()) { attachnpctimer; initnpctimer; } OnTimerQuit: .one_at_a_time = 0; stopnpctimer; detachnpctimer; } @Reborn
-
It looks like the command mobcount was updated at some point to require another parameter. Replace the errored line with... if(!getusers(8)&&mobcount(strnpcinfo(4),"all")){killmonsterall strnpcinfo(4);}
-
@reloadmobdb something like that I can't exactly remember if that refreshes the mobs on a map though.
-
@ViewtifulNinja Good to see you're back at it have you tried like reloading mobs after setting the value just to see if there is a change?
-
Countitem rathena/script_commands.txt at master · rathena/rathena · GitHub Delitem rathena/script_commands.txt at master · rathena/rathena · GitHub Useable items have scripts that are run when they are used from within your database. In those scripts check for the existence of the other boxes when one of them is open. If they exist delete them.
-
It could be interesting way of not actually distributing scripts. Perhaps for the purpose of dynamic updates or some kind of reseller prevention (even though they're being cached). Yeah I'm for it.
-
Amazing work Adel, it's great to see fantastic project like this still being made in 2021. I will always be a support and your work just keeps getting better.
-
Summoning a Dummy NPC that my Character can only see
Skorm replied to Lucinoxth's question in Script Requests
Exactly that's why I mentioned doing it instead with a stationary monster something that could just be spawned on demand then do the checks on the mobs death. Also I didn't know that about unitwarp makes sense though since NPCs and Mobs are very similar and the latter can move between maps. -
Another way that's a little more involved but probably better for the server. Would be to just add an item that the mob could drop which when consumed increases the players zeny by a specific amount. You could make an item for each amount like 1k 10k 100k etc. - script sampledrop -1,{ OnInit: addmonsterdrop 1002,90000,100; // 1% Poring Zeny Bag } Example item_db_usable - Id: 90000 AegisName: Zeny Bag Name: Zeny Bag Type: Cash Buy: 10 Weight: 10 EquipLevelMin: 1 Script: | Zeny += 10000; ----------------------------------------------------------- Again another way that you might accomplish this would be to enable: // Zeny from mobs zeny_from_mobs: yes In monster.conf And then edit the formula in mob.cpp to follow some kind of curve based on mob level. if(battle_config.zeny_from_mobs && md->level) { // zeny calculation moblv + random moblv [Valaris] zeny=(int) ((md->level+rnd()%md->level)*per*bonus/100.); if(md->db->mexp > 0) zeny*=rnd()%250; }
-
Summoning a Dummy NPC that my Character can only see
Skorm replied to Lucinoxth's question in Script Requests
So as far as I know NPCs cannot travel between maps which means there would need to be a duplicate of that hidden npc on every map that you wanted this to work on. With that said there are other ways that this could work with a monster spawning instead but that's not what I've created... I made three versions that work slightly different and have their own unique drawbacks. // This one will throw a Error/Debug if you're on a map where the npc does not exist. prontera,0,0,5 script Hidden NPC#prontera HIDDEN_WARP_NPC,{ if ( strcharinfo(0) == .character$ ) { mes "Blah"; close2; movenpc strnpcinfo(0),0,0; setnpcdisplay(strnpcinfo(0), HIDDEN_WARP_NPC); } end; OnMoveNPC: .character$ = strcharinfo(0); getmapxy([email protected]$,[email protected],[email protected]); setnpcdisplay(strnpcinfo(0), 4_TREASURE_BOX); movenpc strnpcinfo(0),[email protected],[email protected]; } geffen,0,0,0 duplicate(Hidden NPC#prontera) Hidden NPC#geffen HIDDEN_WARP_NPC Item Script: doevent "Hidden NPC#"+strcharinfo(3)+"::OnMoveNPC"; ---------------------------- // This one will not but is hardcoded specific to the character. prontera,0,0,5 script Hidden NPC#1 HIDDEN_WARP_NPC,{ if ( strcharinfo(0) == "AnnieRuru" ) { mes "Blah"; close2; movenpc strnpcinfo(0),0,0; setnpcdisplay(strnpcinfo(0), HIDDEN_WARP_NPC); } end; OnMoveSpecialNPC: getmapxy([email protected]$,[email protected],[email protected],BL_PC,"AnnieRuru"); if( [email protected]$ == strnpcinfo(4) ) { setnpcdisplay(strnpcinfo(0), 4_TREASURE_BOX); movenpc strnpcinfo(0),[email protected],[email protected]; } } geffen,0,0,0 duplicate(Hidden NPC#1) Hidden NPC#2 HIDDEN_WARP_NPC Item Script: donpcevent "::OnMoveSpecialNPC"; --------------------------- // This one might not work from an item I've had problems with functions in items before. // But if it does work should fail silently. prontera,0,0,5 script Hidden NPC#prontera HIDDEN_WARP_NPC,{ if ( strcharinfo(0) == .character$ ) { mes "Blah"; close2; movenpc strnpcinfo(0),0,0; setnpcdisplay(strnpcinfo(0), HIDDEN_WARP_NPC); } end; OnMoveNPC: .character$ = strcharinfo(0); getmapxy([email protected]$,[email protected],[email protected]); setnpcdisplay(strnpcinfo(0), 4_TREASURE_BOX); movenpc strnpcinfo(0),[email protected],[email protected]; } function script Hidden NPC Func { if(getnpcid(0,"Hidden NPC#"+strcharinfo(3))) { doevent "Hidden NPC#"+strcharinfo(3)+"::OnMoveNPC"; } } geffen,0,0,0 duplicate(Hidden NPC#1) Hidden NPC#geffen HIDDEN_WARP_NPC Item Script: callfunc "Hidden NPC Func"; I think @mihaamiharu was really close in sharing @AnnieRuru's original script. Just wish they had done so with code brackets. -
Please help me on this script that'll connect arrays in 1 block of script.
Skorm replied to DR4LUC0N's question in Script Requests
You could make it a bonus that just runs out after an amount of time and resets when they relog. https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L6026 -
Please help me on this script that'll connect arrays in 1 block of script.
Skorm replied to DR4LUC0N's question in Script Requests
Maybe something like this. prontera,157,176,5 script guide 650,1,1,{ end; OnTouch: [email protected] = atoi(strnpcinfo(2)); if([email protected]+1 == getarraysize(.npc_pos_x)) { dispbottom "End"; } else { switch([email protected]) { case 0: npctalk "Hello I'm the first NPC!"; break; case 1: npctalk "Hello I'm the second NPC!"; break; default: npctalk "Hello I'm NPC #"[email protected]+"."; break; } unitwalk getcharid(3),.npc_pos_x[[email protected]+1],.npc_pos_y[[email protected]+1]; } end; OnInit: getmapxy([email protected]$,[email protected],[email protected],BL_NPC,strnpcinfo(0)); [email protected] = atoi(strnpcinfo(2)); .npc_pos_x[[email protected]] = [email protected]; .npc_pos_y[[email protected]] = [email protected]; } prontera,157,170,6 duplicate(guide) guide#1 650,1,1 prontera,157,162,6 duplicate(guide) guide#2 650,1,1 prontera,157,153,6 duplicate(guide) guide#3 650,1,1 prontera,152,150,6 duplicate(guide) guide#4 650,1,1 -
- script EXP_THING -1,{ OnPCLoginEvent: @base_exp = BaseExp; end; OnPCLogoutEvent: [email protected]_exp = BaseExp - @base_exp; } Maybe not completely reliable but I can't think of any other way todo it without individually tracking everything killed or a source mod.