Jump to content

Emistry

Forum Moderator
  • Posts

    10018
  • Joined

  • Days Won

    409

Community Answers

  1. Emistry's post in disable bonus during woe was marked as the answer   
    Script: | bonus bBaseAtk,2600; if (!agitcheck() && !agitcheck2() && !agitcheck3()) bonus2 bHPDrainRate, 1000, 100; just change your item_db instead of adding another script function
  2. Emistry's post in disable bonus during woe was marked as the answer   
    Script: | bonus bBaseAtk,2600; if (!agitcheck() && !agitcheck2() && !agitcheck3()) bonus2 bHPDrainRate, 1000, 100; just change your item_db instead of adding another script function
  3. Emistry's post in Instances command for creating a new dungeon. was marked as the answer   
    instance_db.yml
    - Id: 1 Name: Endless Tower TimeLimit: 14400 Enter: Map: 1@tower X: 50 Y: 355 NPC script
    prontera,155,181,5 script Sample 757,{ .@instance_name$ = "Endless Tower"; if (!is_party_leader()) end; switch(select( "Create", "Enter", "Destroy" )) { case 1: instance_create(.@instance_name$, IM_PARTY); break; case 2: switch(instance_enter(.@instance_name$)) { case IE_NOMEMBER: mes "ERROR: Party not found."; break; case IE_NOINSTANCE: mes "ERROR: Party does not have an instance."; break; case IE_OTHER: mes "ERROR: Unknown error."; break; default: break; } break; case 3: instance_destroy; break; } close; }  
  4. Emistry's post in block enemy clan in castle was marked as the answer   
    - script Sample -1,{ OnInit: .map$ = "prtg_cas01"; setmapflag(.map$, MF_LOADEVENT); end; OnPCLoadMapEvent: if (.map$ == strcharinfo(3) && !(agitcheck() || agitcheck2() || agitcheck3()) { .@castle_guild_id = getcastledata(.map$, CD_GUILD_ID); if (.@castle_guild_id && getcharid(2) != .@castle_guild_id) { mes "You aren't allow to enter this area."; close2; warp "SavePoint", 0, 0; } } end; }  
  5. Emistry's post in about isequippedcnt was marked as the answer   
    if (isequippedcnt(4318) == 1) { bonus3 bAutoSpell,"WZ_STORMGUST",2,20; bonus2 bAddEff,Eff_Freeze,100; } warp the script together.
  6. Emistry's post in item preview NPC was marked as the answer   
    input @itemid; if (getiteminfo(@itemid, ITEMINFO_ID) <= 0) { mes @itemid+" has failed!"; next; goto INTRO; }  
  7. Emistry's post in Help! MVP KIll by pajodex was marked as the answer   
    OnNPCKillEvent: if (getgmlevel() >= .gm ) end; // If gm = event wont happen if ( getmonsterinfo( killedrid, MOB_MVPEXP )) { for (.@a = 0; .@a < getarraysize(.t_maps$); .@a++) { if ( strcharinfo(3) == instance_mapname("06guild_01") ) end; if ( strcharinfo(3) == instance_mapname("force_1-1") ) end; if ( strcharinfo(3) == .t_maps$[.@a]) { if (rand(100) < .chance) getitem .s_rwd[0], .s_rwd[1]; announce "[ System ] : Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" alone at "+ strcharinfo(3), bc_all; MVPKills = MVPKills+1; dispbottom "---------------------------------------------------"; dispbottom "You killed a total of "+MVPKills+" MVP"+((MVPKills == 1)?"":"s")+"."; dispbottom "---------------------------------------------------"; end; } } end; }  
  8. Emistry's post in How to Enable KOE Point shop was marked as the answer   
    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.
     
  9. Emistry's post in guild storage log descending instead of extending upward was marked as the answer   
    SELECT .... FROM .... ORDER BY <column_name> update your SQL query to sort the ordering, or remove the ORDER BY ... DESC
  10. Emistry's post in showscript quest was marked as the answer   
    default come with the Quest System, not showscript(...)
  11. Emistry's post in Error on callfunction random box [ null ] was marked as the answer   
    function script specialbox { .@chance = rand(100); if (.@chance == 1) { // Super Rare Item 1% .@item_id = F_Rand(2199,1599); } else if (.@chance <= 2 && .@chance >= 11) { // Rare Items .@item_id = F_Rand(911,912); } else { // Common Items .@item_id = F_Rand(909,910); } announce "["+strcharinfo(0)+"] won a ["+getitemname(.@item_id)+"] from the Special Box.",0; return; } a simpler and more appropriate approach.
    you shouldn't create/declare a npc variable  within a function ....
    because it shared the value with everyone .. when you declare anything inside the function, it keep repeating the unnecessary process when other player access it again
  12. Emistry's post in Newbie question: how get an item ID by item name, in script? was marked as the answer   
    mes "What item are you looking for?"; input .@name$; .@qty = searchitem(.@matches[0],.@name$); mes "I found " + .@qty + " items:"; for (.@i = 0; .@i < .@qty; .@i++) // Display name (eg: "Apple[0]") mes getitemname(.@matches[.@i]) + "[" + getitemslots(.@matches[.@i]) + "]"; or better 
    getiteminfo("<item name>", ITEMINFO_ID)  
  13. Emistry's post in MOTD for specific party members was marked as the answer   
    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; .@mob_bexp = (getmonsterinfo(killedrid, MOB_BASEEXP) / $@partymembercount); .@mob_jexp = (getmonsterinfo(killedrid, MOB_JOBEXP) / $@partymembercount); .@current_level = BaseLevel; for (.@i = 0; .@i < $@partymembercount; .@i++) { if (attachrid($@partymemberaid[.@i])) { .@gap = (BaseLevel - .@current_level); if (.@gap >= -15 && .@gap <= 15) { dispbottom "[Monster of the Day]: Experience Gained Base:"+F_InsertComma(.@mob_bexp)+" Job:"+F_InsertComma(.@mob_jexp)+""; BaseExp += .@mob_bexp; JobExp += .@mob_jexp; } detachrid; } } end;  
  14. Emistry's post in SE Castle or WOE2 Emp breaker Announcer was marked as the answer   
    npc/guild2/agit_main_se.txt#L623
    change to
    announce strcharinfo(0)+" from the ["+getguildname(.@GID)+"] guild conquered the ["+.@region$+" "+charat(strnpcinfo(2),3)+"] stronghold of "+getcastlename(strnpcinfo(4))+"!",bc_all|bc_woe;  
  15. Emistry's post in Guild Pack NPC which can activate during WOE days was marked as the answer   
    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;  
  16. Emistry's post in dispbottom not correct - Edited Mining Script was marked as the answer   
    dispbottom "You've successfully mined the ore."; if (MineExp < 100000) { if (@minechance >= 12) .@mine_exp = 3; else if (@minechance >= 7) .@mine_exp = 2; else if (@minechance >= 1) .@mine_exp = 1; } if (.@mine_exp) { MineExp += .@mine_exp; dispbottom "You've gained "+.@mine_exp+" Mining Exp."; }  
  17. Emistry's post in Donate once a day only was marked as the answer   
    when player try to donate, add this validation
    if (#motd_daily_limit == gettime(DT_YYYYMMDD)) { mes "[Monster Of The Day]"; mes "You have already donated today. Come back again tomorrow."; close; } when they success donate, add this
    mes "[Monster Of The Day]"; mes "Zeny has succesfully transfered."; Zeny -= .@motd_zeny; $motd_zeny += .@motd_zeny; $motd_diff -= .@motd_zeny; #motd_daily_limit = gettime(DT_YYYYMMDD); // <----- THIS LINE  
  18. Emistry's post in Guild Pack NPC which can activate during WOE days was marked as the answer   
    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;  
  19. Emistry's post in GOLD ROOM POINTS NOT WORKING 2018 CLIENT was marked as the answer   
    if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish; change to
    if (getmapxy(@mapname$, @mapx, @mapy, BL_PC) == -1) goto L_Finish;  
  20. Emistry's post in Input amount on vote npc was marked as the answer   
    try change
    mes "Proceed?"; if(select("Yes:No")==1) { set .@points,getPoints(getcharid(3)); if(.@points>=.@rpoints) { next; mes .npcname$; updatePoints(getcharid(3),.@rpoints); getitem .@ritemid,.@rquantity; mes "Here you go!. Thank you for voting. Don't forget to vote again. :D"; } else mes "Sorry, you do not have enough points for this item."; } into
    mes "Enter an Amount and proceed:"; input .@amount, 1; if(select("Yes:No")==1) { set .@points,getPoints(getcharid(3)); if(.@points>= (.@rpoints * .@amount)) { next; mes .npcname$; updatePoints(getcharid(3),(.@rpoints * .@amount)); getitem .@ritemid,(.@rquantity * .@amount); mes "Here you go!. Thank you for voting. Don't forget to vote again. :D"; } else mes "Sorry, you do not have enough "+(.@rpoints * .@amount)+" points for this item."; }  
  21. Emistry's post in Tournament Team DB Registration was marked as the answer   
    if( query_sql( "SELECT `team_name` FROM `tournament` WHERE `team_name` = '"+escape_sql( .@team_name$ )+"'", .@team_name$ ) ){ you need to assign a variable to store the data you query from database.
  22. Emistry's post in can you chang script was marked as the answer   
    prontera,164,173,3 script Refiner 826,{ mes "^3355FF[%100 Refiner]^000000"; mes "This Lets you refine your item to the max"; mes " You Need "+.amount+"x "+getitemname(.item_id)+" to use my Service"; next; mes "Choose the item to refine"; mes "Choose Wisely"; mes "Dont Ask For refine"; mes "On GameMasters"; mes "Think Before you refine an item"; next; for (.@i = 0; .@i < .eqi_size; .@i++) { if (getequipid(.eqi[.@i]) != -1) .@menu$ = .@menu$ + F_getpositionname(.eqi[.@i]) + " - " +getitemname(getequipid(.eqi[.@i])); .@menu$ += ":"; } .@i = select(.@menu$) - 1; .@refine = getequiprefinerycnt(.eqi[.@i]); if (countitem(.item_id) < .amount) { mes "You didnt have enough "+.amount+"x "+getitemname(.item_id); } else if (.@refine >= 20) { mes "Your item already reached max refine."; } else { delitem .item_id, .amount; if (.@refine < 10) { successrefitem .eqi[.@i], (10 - .@refine); } else { successrefitem .eqi[.@i]; } announce "["+strcharinfo(0)+"], Thanks for using my great service :)).", bc_self; } close; OnInit: .item_id = 7179; .amount = 10; setarray .eqi, EQI_HEAD_TOP, EQI_HEAD_MID, EQI_HEAD_LOW, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R; .eqi_size = getarraysize(.eqi); end; }  
  23. Emistry's post in Reset Stats per status was marked as the answer   
    may try something like this
    prontera,155,181,5 script Sample 757,{ for (.@stat = bStr; .@stat <= bLuk; .@stat++) .@param[.@stat - bStr] = readparam(.@stat); mes "Select the stats to reset to 1."; do { .@menu$ += "Str - "+ .@param[0] + ":"; .@menu$ += "Vit - "+ .@param[1] + ":"; .@menu$ += "Int - "+ .@param[2] + ":"; .@menu$ += "Agi - "+ .@param[3] + ":"; .@menu$ += "Dex - "+ .@param[4] + ":"; .@menu$ += "Luk - "+ .@param[5] + ":"; .@menu$ += "Reset"; .@i = select(.@menu$); .@param[.@i] = 1; } while (.@i <= 6); resetstatus; for (.@stat = bStr; .@stat <= bLuk; .@stat++) { while (readparam(.@stat) < .@param[.@stat - bStr]) statusup .@stat; } end; }  
  24. Emistry's post in Help Ticket Gambler was marked as the answer   
    https://pastebin.com/f4hQEXX2
    you didnt add the announcement at the part it get the reward.
  25. Emistry's post in for()+deletearray, confusion question! was marked as the answer   
    there exists another way for you, in case you afraid to mess up with the index value. 
    for (.@i = getarraysize(.@tmp_magic_shop) - 1; .@i >= 0; .@i--) if(!.@tmp_magic_shop[.@i]) deletearray .@tmp_magic_shop[.@i],1; start looping from the end of the array to the front...
×
×
  • Create New...