Jump to content

Emistry

Forum Moderator
  • Posts

    9,746
  • Joined

  • Days Won

    305

Everything posted by Emistry

  1. bonus bMatk,getrefine(); *getrefine() This function will return the refine count of the equipment from which the function is called. This function is intended for use in item scripts.
  2. //================================================Name====================================================== // Goblin Invasion NPC (Official Release Name) //===============================================Version==================================================== // 1.2 //===============================================Author===================================================== // ____ _____ ______ __ __ __ _______ __ _____ __ __ _______ // | __ \ _ \| __ \| | \ | |/ ___ \ | | / / | \ | |/ ___ \ // | |__| | \ \ |__| | | \| | | _\_/ | |/ /| | \| | | _\_/ // | __/ | | /| | | | |_ \ | | | | | | | |_ \ // | |\ \_/ / |\ \| | |\ | \_/ | | |\ \| | |\ | \_/ | // |__| \_____/|__| \__\__|__| \__|\______/ |__| \__\__|__| \__|\______/ //----------------------------------------Script Last Update 2020------------------------------------------- //==============================================Changelog=================================================== // 1.0 * // - Initial Release // 1.1 // - Added Host Event by GMAccess // 1.2 // - Remove all error from Latest rAthena // - Maximize script // - Fix some dialog of NPC // - Added Mapflag for the Event Map //========================================================================================================== prontera,155,185,6 script Invasion NPC 459,{ set .gm,50;//GM Level to access the GM Menu. Default: 50 // GM menu //It allows GMs Level 50 or more to Start and Stop invasions. if (getgmlevel()>.gm) { if (.mobs_left) { mes "[Invasion]"; mes "An invasion is in progress.."; mes "Location: " + .Map$; mes "^FF0000"+.mobs_left+"^000000 Goblins left"; mes " "; mes "Stop invasion?"; if(select("No:Yes")==1) close; donpcevent "Invasion NPC::OnTimer1805000"; mes "Invasion stopped"; announce "The Invasion has been stopped by "+strcharinfo(0),bc_all; close; } mes "[Invasion]"; mes "Please customize the Invasion event before starting it."; mes "Note - The Goblin Leader drops x5 of the prize."; Main: next; mes "[Invasion]"; switch(select("Item [" + getitemname(.ItemID) + "]:Start Event")) { case 1: mes "Which item would you like the Goblin Leader to drop?"; mes "Please input the item ID:"; input .ItemID; goto Main; case 2: mes "Starting the event now..."; close2; goto OnStart; } // If a player clicks the NPC, it displays: mes "[Invasion]"; mes .mobs_left+" have invaded "+.Map$[.rand_map]+"!"; close; ///////////////////////// //The actual NPC Script// ///////////////////////// OnMinute50: // Change this to your liking OnStart: set .mobs_left, 1; sleep 1000; set [email protected], rand(1,6); if ([email protected] == 6) set .Map$,"guild_vs3"; if ([email protected] == 5) set .Map$,"guild_vs3"; if ([email protected] == 4) set .Map$,"guild_vs3"; if ([email protected] == 3) set .Map$,"guild_vs3"; if ([email protected] == 2) set .Map$,"guild_vs3"; if ([email protected] == 1) set .Map$,"guild_vs3"; sleep 1000; announce "[ Rune-Midgard Guard ]: We have trouble here in the town " + .Map$ + "!", bc_all; sleep 5000; announce "[ Rune-Midgard Guard ]: Everyone, we need your help to get rid of these Goblins!", bc_all; monster .Map$,0,0,"Goblin",1258,10,"Invasion NPC::OnMyMobDead"; monster .Map$,0,0,"Goblin",1299,1,"Invasion NPC::OnMyMobDead"; set .mobs_left, 11; end; OnTimer1805000: // 30 minutes later, kills all the mobs. killmonster .Map$,"Invasion NPC::OnMyMobDead"; set .mobs_left, 0; OnStop://When the event is stopped by a GM, or all monsters dead. killmonster .Map$,"Invasion NPC::OnMyMobDead"; killmonster .Map$,"Invasion NPC::OnSpecialMobDead"; end; OnMyMobDead: //When a Goblin is killed set .mobs_left, .mobs_left-1; if (.mobs_left==0) { announce "[ Rune-Midgard Guard ]: Everyone, thankyou for helping to get rid of these Goblins!", bc_all; getitem .ItemID,20; //Change the [5] to the amount you wish to hand out. donpcevent "Invasion NPC::OnStop"; //announce "[Invasion NPC]: "+strcharinfo(0)+" has killed the last "+.mobname$+".",bc_all; announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all; } else { //announce "["+.mobs_left+"/200] Goblins left.",bc_map; //announce "["+.mobs_left+"-"+200+"="+.mobs_left+"] Goblins left.",bc_map; //announce "[("+.mobs_left+")-(200)="+.mobs_left+"] Goblins left.",bc_map; announce "[ "+strcharinfo(0)+" ] has killed a Goblin. There are now "+.mobs_left+" Goblin left.",bc_map; } end; } end; }
  3. prontera,155,181,5 script Sample 757,{ if (BaseLevel < 99) { mes "You need to be at least level 99."; } else if (select("Reset", "cancel") == 1) { resetlvl 1; RESET_COUNT++; StatusPoint += (RESET_COUNT * 10); // free 10 status point per reset. if (RESET_COUNT && RESET_COUNT % 10 == 0) { getitem 512, 10; // every 10 reset get apple. } } close; }
  4. https://rathena.org/board/topic/90173-item-and-point-shop/ just add your item list //ADD YOUR ITEMS HERE - pointshop KOEPOINTS -1,#KOEPOINTS,501:1 and please use codebox to wrap your code next time.
  5. if (gettime(DT_HOUR) == 17 || (gettime(DT_HOUR) == 18 && gettime(DT_MINUTE) <= 30)) hideoffnpc strnpcinfo(3);
  6. you're specifying a npc name, not a map name. The script command required a map name
  7. hideoffnpc instance_npcname("et_reward_npc"); // <------- ADD THIS
  8. What is the point of create a npc just to preview an item that already exists in your inventory? You can just right away equip the item that exists in your inventory to preview it. Preview feature should be implemented for something that currently doesn't exists.
  9. getskilllist(); for ([email protected] = 0; [email protected] < @skilllist_count; [email protected]++) { if (@skilllist_lv[[email protected]] > 0 && (@skilllist_flag[] == SKILL_PERM || @skilllist_flag[] == SKILL_PERM_GRANT) [email protected]$ = [email protected]$ + "skill_id ["[email protected]_id[[email protected]]+"] lv = "+ @skilllist_lv[[email protected]]; [email protected]$ = [email protected]$ + ":"; } [email protected] = select([email protected]$) - 1; addtoskill @skilllist_id[[email protected]], [email protected]_lv[[email protected]]; SkillPoint += @skilllist_lv[[email protected]]; however, this is not advised to use at server that doesn't allow to bypass skill tree if you want to display the skill name, either create a src mod to retrieve the skill name from db/skill_db (or search forum) or store it in an array and retrieve it.
  10. change into these if you want to keep the random item bonus. *getitem3 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>}; *getitem3 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};
  11. npc/guild2/agit_main_se.txt#L623 change to announce strcharinfo(0)+" from the ["+getguildname([email protected])+"] guild conquered the ["[email protected]$+" "+charat(strnpcinfo(2),3)+"] stronghold of "+getcastlename(strnpcinfo(4))+"!",bc_all|bc_woe;
  12. replace with the new cloakonnpc/cloakoffnpc instead. https://github.com/rathena/rathena/commit/de80c5aab61eff6996a5e4c94d4a5a868eb18ca4
  13. using the left/right shift operators to binary mathematical operations as they have two important qualities: Left-shifting a bitmask once multiplies by two. Right-shifting once divides by two. assuming the following scenario 1 = map_1 2 = map_2 4 = map_3 8 = map_4 16 = map_5 32 = map_6 64 = map_7 when you sum up the value for 1 + 2 + 4 + 8 = 15 (you have access to map1 , map2, map3, map4) when you sum up the value for 4 + 16 + 64 = 84 (you have access to map3, map5, map7) when you sum up all the values , then you have access to all map above. you could only store up to total value of 2147483647
  14. you can try something like this. OnPCLoadMapEvent: if (inarray(.Maps$, strcharinfo(3)) != -1 && @current_map$ != strcharinfo(3)) { //sc_end sc_spirit; sc_end sc_gospel; sc_end SC_POEMBRAGI; sc_end SC_APPLEIDUN; sc_end SC_ASSNCROS; sc_end SC_WHISTLE; //sc_end 37; // holy weapon //sc_end 38; // holy armor sc_end 187; // increase all stat sc_end 194; // increase hit sc_end 196; // increase flee sc_end 198; // max hp increase sc_end 199; // max sp increase sc_end 200; // attach strength sc_end 202; // increase def sc_end 214; // SC_SCRESIST sc_end 175; // POEMBRAGI sc_end 181; // SERVICE4U //specialeffect2 235; @current_map$ = strcharinfo(3); addtimer 3000, strnpcinfo(3)+"::OnCheck"; } end; OnCheck: if (@current_map$ != "") { if (@current_map$ == strcharinfo(3)) addtimer 3000, strnpcinfo(3)+"::OnCheck"; else @current_map$ = ""; } end;
  15. - script Sample -1,{ OnPCLoginEvent: OnPCBaseLvUpEvent: if (@fakename_enabled) atcommand("@fakename"); atcommand("@fakename "+ strcharinfo(0)+" (Lv. "+BaseLevel+")"); @fakename_enabled = 1; end; }
  16. addrid(2,0,getcharid(1)); dispbottom "[Monster of the Day]: Experience Gained Base:"+strmobinfo(6,.mobid)+" Job:"+strmobinfo(7,.mobid)+""; set BaseExp,(BaseExp+strmobinfo(6,.mobid)); set JobExp,(JobExp+strmobinfo(7,.mobid)); end; change into getpartymember getcharid(1), 2; [email protected]_bexp = (getmonsterinfo(killedrid, MOB_BASEEXP) / [email protected]); [email protected]_jexp = (getmonsterinfo(killedrid, MOB_JOBEXP) / [email protected]); [email protected]_level = BaseLevel; for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) { if (attachrid([email protected][[email protected]])) { [email protected] = (BaseLevel - [email protected]_level); if ([email protected] >= -15 && [email protected] <= 15) { dispbottom "[Monster of the Day]: Experience Gained Base:"+F_InsertComma([email protected]_bexp)+" Job:"+F_InsertComma([email protected]_jexp)+""; BaseExp += [email protected]_bexp; JobExp += [email protected]_jexp; } detachrid; } } end;
  17. // Add the maps for your world boss event here. If you only want one, just add one. setarray .WBMAPS$, "prontera"; read the configuration part
  18. [email protected]$ = "SELECT char_id FROM char_reg_str WHERE char_id = '" + escape_sql(.c_id$) + "' AND key = '" + escape_sql(.w_key$) + "'"; https://www.techonthenet.com/mysql/and.php
  19. OnInit: OnClock1700: OnClock1830: hideonnpc strnpcinfo(3); if (gettime(DT_DAYOFWEEK) == TUESDAY || gettime(DT_DAYOFWEEK) == THURSDAY || gettime(DT_DAYOFWEEK) == SUNDAY ) { if (gettime(DT_HOUR) == 17 || (gettime(DT_HOUR) == 18 && gettime(DT_MINUTE) <= 30)) hideoffnpc strnpcinfo(3); } end;
  20. prontera,114,154,5 script Poring Race 568,{ if (getgmlevel() >= 99) { mes "Would you like to "++" the event?"; if (select("continue", (.access_Prace) ? "Stop Event" : "Start Event") == 2) { if (.access_Prace) { donpcevent strnpcinfo(3)+"::OnPraceEnd"; mes "event stopped."; } else { donpcevent strnpcinfo(3)+"::OnPraceStart"; mes "event started."; } close; } } if( .access_Prace == 0 ) { mes "[Event Employee: Poring Race]"; mes "Poring Race has ended."; close; } mes "[Event Employee: Poring Race]"; mes "Do you want to participate on Poring Race?"; if( select( "Yes","No" ) -1 ) { next; mes "[Event Employee: Poring Race]"; mes "See you again next time!"; close; } if( .access_Prace == 0 ) { next; mes "[Event Employee: Poring Race]"; mes "..."; mes "..."; mes "Cheater!!~~"; close; } close2; @prace_winner$ = ""; warp "p_track01",52,41; end; // OnInit: OnClock1434: if( gettime(3)%2 ) end; OnPraceStart: set .access_Prace, 1; announce "Event Employee [Poring Race]: Poring Race is about to begin. To participate kindly approach me at Event Room or use @event",0; setnpctimer 100000,"Bidder#prace0"; startnpctimer "Bidder#prace0"; end; OnPraceEnd: set .access_Prace, 0; announce "Event Employee [Poring Race]: Poring Race is over! Thank you for participating.",0; end; } try
  21. OnTue1800: OnThu1800: OnSun1800: hideoffnpc strnpcinfo(3); end; OnTue2000: OnThu2000: OnSun2000: hideonnpc strnpcinfo(3); end; OnClock<hour><minute>: OnMinute<minute>: OnHour<hour>: On<weekday><hour><minute>: OnDay<month><day>:
  22. use gettimetick if (#luckyspin < gettimetick(2)){ #luckyspin = gettimetick(2) + (3600 * 12);
  23. probably something went wrong with the script, always check map-server for errors.
  24. https://rathena.org/board/topic/129536-problem-about-guild-emblem-useing-web-serviec-not-show/
  25. prontera,155,181,5 script Sample 757,{ if (getcharid(2) && #GUILD_PACK_CD != gettime(DT_YYYYMMDD)) { #GUILD_PACK_CD = gettime(DT_YYYYMMDD); getitem 30005, 1; } end; OnInit: OnHour00: if (gettime(DT_DAYOFWEEK) != TUESDAY && gettime(DT_DAYOFWEEK) != THURSDAY && gettime(DT_DAYOFWEEK) != SUNDAY ) { hideonnpc strnpcinfo(3); } end; } - Id: 30005 AegisName: G-Pack Script: | rentitem 1201, 86400; rentitem 1202, 86400; rentitem 1203, 86400;
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.