Jump to content

Skorm

Forum Moderator
  • Posts

    1282
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Skorm

  1. Ehh this is what I got when I asked awhile ago. In other word garbage because of the email filter. - script Item Exchange -1,{ // Item IDs and exchange rates setarray .itemList,501,502,503,504; setarray .exchangeRates,10,20,30,40; // Reward IDs and amounts setarray .rewardList,1001,1002,1003,1004; setarray .rewardAmounts,1,2,3,4; mes "Hello there! I am the Item Exchange NPC."; mes "I can exchange certain items for rewards."; next; mes "Here is the list of items that I accept:"; for (set [email protected],0; [email protected] < getarraysize(.itemList); set [email protected],[email protected]+1) { mes "- " + getitemname(.itemList[[email protected]]) + " x " + .exchangeRates[[email protected]]; } next; mes "What would you like to exchange today?"; [email protected] = select("Exchange an item for a reward","I'll come back later"); if ([email protected] == 2) { close; } mes "Great! Please select the item that you would like to exchange."; [email protected] = menu("Please select the item:", getitemname(.itemList)); if ([email protected] == 0) { mes "You don't have any of the required items."; close; } [email protected] -= 1; mes "You have selected " + getitemname(.itemList[[email protected]]) + "."; mes "How many of these items would you like to exchange?"; [email protected] = input("Please enter the quantity:"); if ([email protected] <= 0) { mes "You must enter a valid quantity."; close; } if ([email protected] > getitemcount(.itemList[[email protected-1]])) { mes "You don't have enough of the selected item."; close; } mes "You have selected to exchange " + [email protected] + " " + getitemname(.itemList[[email protected-1]]) + "."; mes "Here is the list of rewards that you can choose from:"; for (set [email protected],0; [email protected] < getarraysize(.rewardList); set [email protected],[email protected]+1) { mes "- " + getitemname(.rewardList[[email protected]]) + " x " + .rewardAmounts[[email protected]]; } next; mes "Which reward would you like to receive?"; [email protected] = menu("Please select your reward:", getitemname(.rewardList)); if ([email protected] == 0) { mes "You must select a valid reward."; close; } [email protected] -= 1; mes "You have selected " + getitemname(.rewardList[[email protected]]) + "."; mes "Here is your reward:"; getitem .rewardList[[email protected]], .rewardAmounts[[email protected]]; delitem .itemList[[email protected]], .exchangeRates[[email protected]] * [email protected]; close; }
  2. @Enoch It's just easier to make two separate npcs and just disable the one for that player after they've completed the quest. But you might be able to use these two commands I'm pretty sure they work on npcs. rathena/script_commands.txt at master · rathena/rathena · GitHub rathena/script_commands.txt at master · rathena/rathena · GitHub Then you could get the npcs position and branch on that. ---- If you wanted to go about disabling the npc for just that player you could try... rathena/script_commands.txt at master · rathena/rathena · GitHub With like a proximity trigger and then just add a condition within the npc to ignore clicks from people that have completed that part of the quest.
  3. I forgot to escape the quotations. Edit: Also as it might not be clear, the first line of what I posted goes within the item_db while the remaining portion of the content is a separate NPC that should be loaded as such. Also, I recommend having @SM_BASH_BONUS = 0; within the equip and unequip script calls and not the main script call as that gets triggered irregularly.
  4. @Kyunhee I've never used autobonus like this but it seems like it could work. The only problem I can see right off the bat is that .@d is a scope variable it's unlikely that bonus script and other script are within scope. Instead, I would try using a character variable. Keep in mind that at the end of the bonuseffect you would need to rest it via a timer or something. You might also have to reapply the bonus I'm unsure if that's done also on attack. autobonus3 "{bonus2 bSkillAtk,\"SM_BASH\",@SM_BASH_BONUS; if(!@SM_BASH_TIMER){addtimer(10000,\"SM_BASH_NPC::On10Seconds\"); @SM_BASH_TIMER = 1;}}",1000,10000,"SM_BASH","{if(@SM_BASH_BONUS<30){@SM_BASH_BONUS += 10;}}"; - script SM_BASH_NPC -1,{ On10Seconds: @SM_BASH_TIMER = 0; @SM_BASH_BONUS = 0; end; } I don't have access to my local test server at the moment so this is all speculation.
  5. @yodaGG If the guild master is offline, it's a bit annoying to get that information because there are many places where the item could be. .@gm_aid = getcharid(3,getguildmaster(getcharid(2))); .@gm_cid = getguildmasterid(getcharid(2)); if(isloggedin(.@gm_aid, .@gm_cid)) { if(countitem(.Premium_Ticket,.@gm_aid)) { // Do buffs } } else { // If they Guild Master is not online we search the SQL database. .@inventory = max(query_sql("SELECT `nameid` FROM `inventory` WHERE `char_id` = "+.@gm_cid+";",.@id), 0); .@storage = max(query_sql("SELECT `nameid` FROM `storage` WHERE `char_id` = "+.@gm_cid+";",.@id), 0); if(.@inventory||.@storage) { // Do buffs } } I'm not sure what the SQL tables and column names are strictly off the top of my head, so the above example probably won't work, but you could fill in the correct details.
  6. @yodaGG prontera,158,192,3 script Healer 621,{ specialeffect2 EF_HEAL2; percentheal 100,100; specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,600000,10; specialeffect2 EF_ASSUMPTIO; sc_start SC_ASSUMPTIO,600000,5; specialeffect2 EF_BLESSING; sc_start SC_BLESSING,600000,10; specialeffect2 EF_ANGELUS; sc_start SC_ANGELUS,600000,10; specialeffect2 EF_GLORIA; sc_start SC_GLORIA,600000,5; if (countitem(.VIP_item) || countitem(.Premium_Ticket)) { specialeffect2 EF_BLESSING; sc_start SC_BLESSING,600000,10; specialeffect2 HP_ASSUMPTIO; sc_start HP_ASSUMPTIO,600000,10; specialeffect2 EF_ANGELUS; sc_start SC_ANGELUS,600000,10; specialeffect2 EF_SUFFRAGIUM; sc_start SC_SUFFRAGIUM,600000,3; specialeffect2 EF_IMPOSITIO; sc_start SC_IMPOSITIO,600000,5; specialeffect2 EF_GLORIA; sc_start SC_GLORIA,600000,5; specialeffect2 EF_MAGNIFICAT; sc_start SC_MAGNIFICAT,600000,5; specialeffect2 EF_CHEMICALPROTECTIOn; sc_start SC_CP_WEAPON,600000,5; sc_start SC_CP_ARMOR,600000,5; sc_start SC_CP_SHIELD,600000,5; sc_start SC_CP_HELM,600000,5; specialeffect2 EF_ASSUMPTIO; sc_start SC_ASSUMPTIO,600000,5; sc_start SC_ADRENALINE2,600000,1; specialeffect2 EF_MAXPOWER; sc_start SC_MAXIMIZEPOWER,600000,5; specialeffect2 EF_PERFECTION; sc_start SC_WEAPONPERFECTION,600000,5; specialeffect2 EF_ENDURE; sc_start SC_ENDURE,600000,10; sc_start SC_KAUPE,600000,3; sc_start SC_KAITE,600000,7; sc_start SC_STRFOOD,600000,5; sc_start SC_AGIFOOD,600000,5; sc_start SC_VITFOOD,600000,5; sc_start SC_INTFOOD,600000,5; sc_start SC_DEXFOOD,600000,5; sc_start SC_LUKFOOD,600000,5; switch ( CLASS ) { case 18: case 4019: case 4071: case 4078: skilleffect "SL_ALCHEMIST",0; sc_start4 SC_SPIRIT,9999999,5,455,0,0; break; case 15: case 4016: case 4070: case 4077: skilleffect "SL_MONK",0; sc_start4 SC_SPIRIT,9999999,5,447,0,0; break; case 4047: skilleffect "SL_STAR",0; sc_start4 SC_SPIRIT,9999999,5,448,0,0; break; case 16: case 4017: case 4067: case 4074: skilleffect "SL_SAGE",0; sc_start4 SC_SPIRIT,9999999,5,449,0,0; break; case 14: case 4015: case 4066: case 4073: skilleffect "SL_CRUSADER",0; sc_start4 SC_SPIRIT,9999999,5,450,0,0; break; case 23: case 4190: skilleffect "SL_SUPERNOVICE",0; sc_start4 SC_SPIRIT,9999999,5,451,0,0; break; case 7: case 4008: case 4054: case 4060: skilleffect "SL_KNIGHT",0; sc_start4 SC_SPIRIT,9999999,5,452,0,0; break; case 9: case 4010: case 4055: case 4061: skilleffect "SL_WIZARD",0; sc_start4 SC_SPIRIT,9999999,5,453,0,0; break; case 8: case 4009: case 4057: case 4063: skilleffect "SL_PRIEST",0; sc_start4 SC_SPIRIT,9999999,5,454,0,0; break; case 19: case 20: case 4020: case 4021: case 4068: case 4069: case 4075: case 4076: skilleffect "SL_BARDDANCER",0; sc_start4 SC_SPIRIT,9999999,5,455,0,0; break; case 17: case 4018: case 4072: case 4079: skilleffect "SL_ROGUE",0; sc_start4 SC_SPIRIT,9999999,5,456,0,0; break; case 12: case 4013: case 4059: case 4065: skilleffect "SL_ASSASIN",0; sc_start4 SC_SPIRIT,9999999,5,457,0,0; break; case 10: case 4011: skilleffect "SL_BLACKSMITH",0; sc_start4 SC_SPIRIT,9999999,5,458,0,0; break; case 11: case 4012: case 4056: case 4062: skilleffect "SL_HUNTER",0; sc_start4 SC_SPIRIT,9999999,5,460,0,0; break; case 4049: skilleffect "SL_SOULLINKER",0; sc_start4 SC_SPIRIT,9999999,5,461,0,0; break; default: break; } } end; OnInit: .VIP_item = 7854; //itemId .Premium_Ticket = 7608; end; } This part: if (countitem(.VIP_item) || countitem(.Premium_Ticket)) { Means if the player has at least 1 of .VIP_item or .Premium_Ticket allow. If it helps I made a small truth table for you. P q &&(and) ||(or) T T T T T F F T F T F T F F F F It's good to keep in mind that these are logical operators and as such aren't entirely identical to bitwise operators. Although both can be used in a similar way. Here's a table for the bitwise operators that you can use in rAthena. (Excluding bitwise NOT(~)) P q &(AND) |(OR) ^(XOR) T T T T F T F F T T F T F T T F F F F F
  7. @yodaGG Hard to say exactly what you want since English doesn't seem to be your first language, but I've added what I think you're asking for, and maybe you can figure it out from there. prontera,158,192,3 script Healer 621,{ if (getguildname(getcharid(2)) == "Fratenity") { specialeffect2 EF_HEAL2; percentheal 100,100; specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,600000,10; specialeffect2 EF_ASSUMPTIO; sc_start SC_ASSUMPTIO,600000,5; specialeffect2 EF_BLESSING; sc_start SC_BLESSING,600000,10; specialeffect2 EF_ANGELUS; sc_start SC_ANGELUS,600000,10; specialeffect2 EF_GLORIA; sc_start SC_GLORIA,600000,5; if (countitem ( .VIP_item ) || countitem(.Premium_Ticket)) { specialeffect2 EF_BLESSING; sc_start SC_BLESSING,600000,10; specialeffect2 HP_ASSUMPTIO; sc_start HP_ASSUMPTIO,600000,10; specialeffect2 EF_ANGELUS; sc_start SC_ANGELUS,600000,10; specialeffect2 EF_SUFFRAGIUM; sc_start SC_SUFFRAGIUM,600000,3; specialeffect2 EF_IMPOSITIO; sc_start SC_IMPOSITIO,600000,5; specialeffect2 EF_GLORIA; sc_start SC_GLORIA,600000,5; specialeffect2 EF_MAGNIFICAT; sc_start SC_MAGNIFICAT,600000,5; specialeffect2 EF_CHEMICALPROTECTIOn; sc_start SC_CP_WEAPON,600000,5; sc_start SC_CP_ARMOR,600000,5; sc_start SC_CP_SHIELD,600000,5; sc_start SC_CP_HELM,600000,5; specialeffect2 EF_ASSUMPTIO; sc_start SC_ASSUMPTIO,600000,5; sc_start SC_ADRENALINE2,600000,1; specialeffect2 EF_MAXPOWER; sc_start SC_MAXIMIZEPOWER,600000,5; specialeffect2 EF_PERFECTION; sc_start SC_WEAPONPERFECTION,600000,5; specialeffect2 EF_ENDURE; sc_start SC_ENDURE,600000,10; sc_start SC_KAUPE,600000,3; sc_start SC_KAITE,600000,7; sc_start SC_STRFOOD,600000,5; sc_start SC_AGIFOOD,600000,5; sc_start SC_VITFOOD,600000,5; sc_start SC_INTFOOD,600000,5; sc_start SC_DEXFOOD,600000,5; sc_start SC_LUKFOOD,600000,5; switch ( CLASS ) { case 18: case 4019: case 4071: case 4078: skilleffect "SL_ALCHEMIST",0; sc_start4 SC_SPIRIT,9999999,5,455,0,0; break; case 15: case 4016: case 4070: case 4077: skilleffect "SL_MONK",0; sc_start4 SC_SPIRIT,9999999,5,447,0,0; break; case 4047: skilleffect "SL_STAR",0; sc_start4 SC_SPIRIT,9999999,5,448,0,0; break; case 16: case 4017: case 4067: case 4074: skilleffect "SL_SAGE",0; sc_start4 SC_SPIRIT,9999999,5,449,0,0; break; case 14: case 4015: case 4066: case 4073: skilleffect "SL_CRUSADER",0; sc_start4 SC_SPIRIT,9999999,5,450,0,0; break; case 23: case 4190: skilleffect "SL_SUPERNOVICE",0; sc_start4 SC_SPIRIT,9999999,5,451,0,0; break; case 7: case 4008: case 4054: case 4060: skilleffect "SL_KNIGHT",0; sc_start4 SC_SPIRIT,9999999,5,452,0,0; break; case 9: case 4010: case 4055: case 4061: skilleffect "SL_WIZARD",0; sc_start4 SC_SPIRIT,9999999,5,453,0,0; break; case 8: case 4009: case 4057: case 4063: skilleffect "SL_PRIEST",0; sc_start4 SC_SPIRIT,9999999,5,454,0,0; break; case 19: case 20: case 4020: case 4021: case 4068: case 4069: case 4075: case 4076: skilleffect "SL_BARDDANCER",0; sc_start4 SC_SPIRIT,9999999,5,455,0,0; break; case 17: case 4018: case 4072: case 4079: skilleffect "SL_ROGUE",0; sc_start4 SC_SPIRIT,9999999,5,456,0,0; break; case 12: case 4013: case 4059: case 4065: skilleffect "SL_ASSASIN",0; sc_start4 SC_SPIRIT,9999999,5,457,0,0; break; case 10: case 4011: skilleffect "SL_BLACKSMITH",0; sc_start4 SC_SPIRIT,9999999,5,458,0,0; break; case 11: case 4012: case 4056: case 4062: skilleffect "SL_HUNTER",0; sc_start4 SC_SPIRIT,9999999,5,460,0,0; break; case 4049: skilleffect "SL_SOULLINKER",0; sc_start4 SC_SPIRIT,9999999,5,461,0,0; break; default: break; } } } end; OnInit: .VIP_item = 7854; //itemId .Premium_Ticket = 7608; end; }
  8. Here is a segment from one of my paid scripts where is use this command. monster 'map$,158,239,"--ja--",'boss_id,1,instance_npcname("oghcm#control")+"::OnBossDeath"; 'boss = $@mobid[0]; getunitdata 'boss,.@boss_data; unitskillusepos 'boss,91,5,.@boss_data[UMOB_X],.@boss_data[UMOB_Y],-2; This works for me. The only difference I can see is that I am providing the last parameter which is cast time. Also, I'm using `unitskillusepos`.
  9. Your labels where incorrect it seems like mR L fixed them for you. Although your explanation isn't that great so I'm not entirely sure if this script is working the way you want it to. I can only confirm that the script mR L provided will work.
  10. https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L6998 These timers are stored as part of the player. - script test015677 -1,{ OnPCLoginEvent: addtimer 60000,"test015677::On60secs"; // Apply Timer... end; On60secs: dispbottom "60 seconds have passed!"; if(checkidle() >= 60 && !checkchatting() && !checkvending()) // Check if idle for 60 seconds or more and not in a chatroom and not vending. atcommand "@kick " + strcharinfo(0); // Is it even possible to kick yourself? xD else addtimer 60000,"test015677::On60secs"; // Reapply timer... end; }
  11. bonus4 bAutoSpell,"AC_CONCENTRATION",max(getskilllv("AC_CONCENTRATION"),3),n,0; Where n is the percent of cast. It does not say in the description so I guess that's up to you.
  12. I do not believe it's possible to query quest_db.yml. You could convert it into an SQL database and query it from there. Depending on the information you need to know you might be able to use existing commands to search for it.
  13. Since someone decided to resurrect this from the grave with pretty irrelevant information. I'll post on topic. Lately I've been playing: Hatsune Miku: Project DIVA Mega Mix+ Rocket League I am Setsuna Risk of Rain 2 Fall Guys Blazblue Central Fiction So those are my current favorites.
  14. @Dolphin86 This sounds fake has hell. Perhaps a player is playing a prank on you? My suggestion is try hosting your files somewhere else like Mega. I think there are other anonymous hosting platforms.
  15. Skorm

    Rent npc

    close; end; @Pride The end; is not needed here because close; also does end;. If using close2; you would need an end;. There is also close3; which removes cutin and then does end;. Also just a personal thing but using the TAB key to space things out helps a lot for readability.
  16. @superblackcat So two ways I might do it... One where both players need to be online and the referrer needs to claim the referral. prontera,100,100,5 script refer a friend 100,{ switch(select("Add Referral:Claim Referral")) { case 1: if(referrer$ != "") { mes "You've already set a referrer."; close; } mes "Input the character name of the person who referred you. (This cannot be changed so make sure it's correct!)"; next; input .@player_name$; mes "Is this correct?"; mes .@player_name$; next; if(select("Yes:No") == 1) { referrer$ = .@player_name$; mes "Congratulations the referrer has been set!"; } break; case 2: mes "Enter the name of the person you referred."; next; input .@player_name$; .@cid = convertpcinfo(.@player_name$, CPC_CHAR); if(.@cid <= 0) { mes "Make sure you've entered that persons name correctly and that they are online."; close; } .@referrer$ = getvar(referrer$, .@cid); .@ref_claimed = getvar(ref_claimed$, .@cid); if(.@referrer$ == strcharinfo(0) && !.@ref_claimed) { getvar(ref_claimed$, .@cid) = True; getitem 501, 1; mes "That's great!"; } else { mes "Hmm... It doesn't seem like you referred that person."; } break; } close; } Another where only the referral needs to submit the referrer and the referrer gets a mailed reward. prontera,100,100,5 script refer a friend 100,{ if(referrer$ != "") { mes "You've already set a referrer."; close; } mes "Input the character name of the person who referred you. (This cannot be changed so make sure it's correct!)"; next; input .@player_name$; mes "Is this correct?"; mes .@player_name$; next; if(select("Yes:No") == 1) { .@len = query_sql("SELECT `char_id` FROM `char` WHERE `name` = '"+escape_sql(.@player_name$)+"';", .@cid); if(.@len > 0) { referrer$ = .@player_name$; .@charid = .@cid; .@sender$ = strcharinfo(0); .@title$ = "Referral Reward!"; .@body$ = "Thanks for being awesome!"; .@zeny = 10000; mail .@charid, .@sender$, .@title$, .@body$, .@zeny; mes "Congratulations the referrer has been set!"; } else { mes "They don't seem to exist."; } } close; }
  17. I've used OpenKore and it identifies mobs by an ID not name. So it wouldn't fail a test like this and instead would just be annoying for normal players.
  18. @ays297 prontera,100,100,5 script gold_room_timer -1,500,500,{ end; OnTouch: // On touch reset the timer... initnpctimer; end; OnTimer1800000: // On 30 minutes remove monsters if the map is empty & restart timer. if(getmapusers(.map_name$) <= 0) { killmonsterall .map_name$; cleanmap .map_name$; } initnpctimer; end; OnInit: // On server start the timer... .map_name$ = strnpcinfo(4); initnpctimer; end; }
  19. 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.
  20. https://pastebin.com/pX5nFgdp I'll update the original post.
  21. 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.
  22. 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: .@equipped = true; if(inarray(.maps$,strcharinfo(3)) != -1) { for(.@a = 0; .@a < .slotlen; .@a++) .@equipped &= !getequipcardcnt(.slots[.@a]); if(.@equipped) end; for(.@a = 0; .@a < .slotlen; .@a++) { if(inarray(.@itemids,getequipid(.slots[.@a])) == -1) { .@itemids[getarraysize(.@itemids)] = getequipid(.slots[.@a]); for(.@i = 0; .@i < 4; .@i++) { .@cardid = getequipcardid(.slots[.@a],.@i); if(.@cardid >= 4000) { getmapunits(BL_PC,strcharinfo(3),.@mapusers[0]); // Add player to ongoing list. for(.@j = 0; .@j < getarraysize(.@mapusers); .@j++) { if(inarray(getd("."+strcharinfo(3)+"_mapusers"), .@mapusers[.@j]) != -1) { setd "."+strcharinfo(3)+"_mapusers["+getarraysize(getd("."+strcharinfo(3)+"_mapusers"))+"]", .@mapusers[.@j]; } } for(.@j = 0; .@j < getarraysize(getd("."+strcharinfo(3)+"_mapusers")); .@j++) { // Remove player and item list. if(inarray(.@mapusers, getd("."+strcharinfo(3)+"_mapusers["+.@j+"]")) != -1) { deletearray "."+strcharinfo(3)+"_"+getd("."+strcharinfo(3)+"_mapusers["+.@j+"]")+"_mapitems"; deletearray getd("."+strcharinfo(3)+"_mapusers["+.@j+"]"), 1; } // Searching through lists of map players cards... else if(getcharid(3) != getd("."+strcharinfo(3)+"_mapusers["+.@j+"]")) { if(inarray(getd("."+strcharinfo(3)+"_"+getd("."+strcharinfo(3)+"_mapusers["+.@j+"]")+"_mapitems"), .@cardid) != -1) { warp "prontera",0,0; dispbottom "You've been removed from the map because someone else is already using "+getitemname(.@cardid)+"."; end; } } } // Adding card to the current players list. setd "."+strcharinfo(3)+"_"+getcharid(3)+"_mapitems["+getarraysize(getd("."+strcharinfo(3)+"_"+getcharid(3)+"_mapitems"))+"]", .@cardid; } } } } } 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(.@a = 0; .@a < getarraysize(.maps$); .@a++) setmapflag .maps$[.@a], mf_loadevent; }
  23. ++.@i Is incremented before evaluation. Example: if(++.@a == 1) //True if(.@a++ == 1) //False
  24. Ahh topic title is misleading then.
×
×
  • Create New...