Jump to content

Skorm

Forum Moderator
  • Posts

    1282
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Skorm

  1. 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?
  2. @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`;", .@mob_ids); .@len = getarraysize(.@mob_ids); for(.@a = 0; .@a < .@len; .@a++) { addmonsterdrop .@mob_ids[.@a],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; }
  3. 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.
  4. 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; }
  5. @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.
  6. 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
  7. 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);}
  8. @reloadmobdb something like that I can't exactly remember if that refreshes the mobs on a map though.
  9. @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?
  10. Skorm

    New char Box's

    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.
  11. 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.
  12. 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.
  13. 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.
  14. 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; }
  15. 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(.@map$,.@x,.@y); setnpcdisplay(strnpcinfo(0), 4_TREASURE_BOX); movenpc strnpcinfo(0),.@x,.@y; } 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(.@map$,.@x,.@y,BL_PC,"AnnieRuru"); if( .@map$ == strnpcinfo(4) ) { setnpcdisplay(strnpcinfo(0), 4_TREASURE_BOX); movenpc strnpcinfo(0),.@x,.@y; } } 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(.@map$,.@x,.@y); setnpcdisplay(strnpcinfo(0), 4_TREASURE_BOX); movenpc strnpcinfo(0),.@x,.@y; } 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.
  16. 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
  17. Maybe something like this. prontera,157,176,5 script guide 650,1,1,{ end; OnTouch: .@index = atoi(strnpcinfo(2)); if(.@index+1 == getarraysize(.npc_pos_x)) { dispbottom "End"; } else { switch(.@index) { 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 #"+.@index+"."; break; } unitwalk getcharid(3),.npc_pos_x[.@index+1],.npc_pos_y[.@index+1]; } end; OnInit: getmapxy(.@map$,.@x,.@y,BL_NPC,strnpcinfo(0)); .@index = atoi(strnpcinfo(2)); .npc_pos_x[.@index] = .@x; .npc_pos_y[.@index] = .@y; } 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
  18. Skorm

    Get total exp

    - script EXP_THING -1,{ OnPCLoginEvent: @base_exp = BaseExp; end; OnPCLogoutEvent: .@gained_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.
  19. Skorm

    Investor

    For an MMO RO's PvP system is amazing. Also I think there is something to be said about the responsiveness and perspective RO provides. You've got what feels like almost frame perfect control of your character on a good server.
  20. Skorm

    Guild Package.

    I cannot be bothered to test this but I'm pretty sure... At line 983 would do the trick. if(sd != NULL && sd->status.guild_id == guild_id) { // do stuff that needs the guild_id first, BEFORE we wipe it npc_event_doall_id("OnLeaveGuild", account_id); if (sd->state.storage_flag == 2) //Close the guild storage. storage_guild_storageclose(sd); guild_send_dot_remove(sd); channel_pcquit(sd,3); //leave guild and ally chan sd->status.guild_id = 0; sd->guild = NULL; sd->guild_emblem_id = 0; if (g->instance_id) { struct map_data *mapdata = map_getmapdata(sd->bl.m); if (mapdata->instance_id) { // User was on the instance map if (mapdata->save.map) pc_setpos(sd, mapdata->save.map, mapdata->save.x, mapdata->save.y, CLR_TELEPORT); else pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT); } } clif_name_area(&sd->bl); //Update display name [Skotlex] status_change_end(&sd->bl,SC_LEADERSHIP,INVALID_TIMER); status_change_end(&sd->bl,SC_GLORYWOUNDS,INVALID_TIMER); status_change_end(&sd->bl,SC_SOULCOLD,INVALID_TIMER); status_change_end(&sd->bl,SC_HAWKEYES,INVALID_TIMER); status_change_end(&sd->bl,SC_EMERGENCY_MOVE,INVALID_TIMER); //@TODO: Send emblem update to self and people around } else { npc_event_doall_id("OnKickGuild"); } If they are not online when being kicked it would trigger OnKickGuild without an RID attached. Edit: Also moved topic to source requests since it's becoming a source thing.
  21. - script Sample -1,{ OnPointGet: #CASHPOINTS++; end; OnPCLoginEvent: addtimer 60000,"Sample::OnPointGet"; }
  22. Skorm

    PVP Party Warp

    Ahh yeah I see what they meant by that now sorry about that. I blame crappy documentation.
  23. Skorm

    PVP Party Warp

    Ahh yeah I forgot that .@party_id was no longer being set. Anyways the way you have it now will not work right since warpparty is within the for loop. In my example it is outside the for loop and will only get run once as it should. Also I've modified my original post with the corrected script segment.
  24. Ahh yeah would be interesting if someone could dig up the files for it. Would work well if the 3d bones client mod.
×
×
  • Create New...