Jump to content

Haruka Mayumi

Content Moderator
  • Posts

    474
  • Joined

  • Last visited

  • Days Won

    26

Community Answers

  1. Haruka Mayumi's post in How to make Reset Stone a usable item? was marked as the answer   
    Should have use search button before posting. There's a lot on rAthena forums. Heres the recent one
     
  2. Haruka Mayumi's post in Finger Offensive: only one sphere used was marked as the answer   
    trunk/conf/battle/skill.conf
    Change it to 1
    // Which finger offensive style will be used? // 0 = Aegis style (single multi-hit attack) // 1 = Athena style (multiple consecutive attacks) finger_offensive_type: 0  
  3. Haruka Mayumi's post in (HELP) about client name was marked as the answer   
    Use Nemo to patch a clean client.

    There's a patch for it called " Custom Window Title ".
  4. Haruka Mayumi's post in Disable warping directly to npc using @warp was marked as the answer   
    warp_get_suggestions(sd, map_name); return -1; } - if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS)) - { //This is to prevent the pc_setpos call from printing an error. - clif_displaymessage(fd, msg_txt(sd,2)); // Invalid coordinates, using random target cell. - if (!map_search_freecell(NULL, m, &x, &y, 10, 10, 1)) - x = y = 0; //Invalid cell, use random spot. - } + if (x || y) { //This is to prevent the pc_setpos call from printing an error. + if(map_getcell(m, x, y, CELL_CHKNOPASS)){ + clif_displaymessage(fd, msg_txt(sd,2)); // Invalid coordinates, using random target cell. + if (!map_search_freecell(NULL, m, &x, &y, 10, 10, 1)) + x = y = 0; //Invalid cell, use random spot. + } else { + struct map_data *mapdata = map_getmapdata(m); + for (int i = 0; i < mapdata->npc_num; i++) + if( x == mapdata->npc[i]->bl.x && y == mapdata->npc[i]->bl.y ){ + if (!map_search_freecell(NULL, m, &x, &y, 1, 1, 1)) + x = y = 0; + break; + } + } + }  
  5. Haruka Mayumi's post in How to add credit point to my id was marked as the answer   
    @cash command
    e.g : @cash 10000

    you can also use the variable #CASHPOINTS
     
  6. Haruka Mayumi's post in BGM not working was marked as the answer   
    do all BGM don't work?. then you don't probably have the mp3dec or/and mssfast on your folder.
    Mp3dec.asiMssfast.m3d
  7. Haruka Mayumi's post in Problem with Pet Evolution was marked as the answer   
    There's no Mastering Pet on your pet_db.yml

    pet_db.yml
    item_db.txt
     
  8. Haruka Mayumi's post in How can i duplicate this NPC? was marked as the answer   
    QUEST.txt
  9. Haruka Mayumi's post in Data to Data.grf was marked as the answer   
    Download : GRF Editor
    1. New > new grf.
    2. Add files..
    3. Save it. done.
  10. Haruka Mayumi's post in Change achievements's titles names. was marked as the answer   
    Locate : data\luafiles514\lua files\datainfo\titletable.lub
  11. Haruka Mayumi's post in how to put announce and pub chat on Prize Giver NPC was marked as the answer   
    1. Quest Board
    //===== rAthena Script ======================================= //= tr0n's Questboard //===== By: ================================================== //= tr0n //===== Current Version: ===================================== //= 1.6.5 //===== Description: ========================================= //= Easily add collection and hunting quests. //===== Changelogs: ========================================== // 1.0.0 Release // 1.1.0 Added zeny reward // 1.2.0 Rewrote checkmob and killcounter // 1.3.1 Added level restriction // 1.3.4 Added Reward Item Amount // 1.4.4 Added Quest delay // 1.5.4 Added repeatable Quests // 1.6.4 Added party support // 1.6.5 Bug fixes for party support //============================================================ prontera,147,173,5 script Event Monsters 676,{ if(c_run==true){ mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + currentquest$ + "_collectionname$")+"^000000"; mes "--------------------------------"; set [email protected], getarraysize(getd("."+ currentquest$ + "_collectionitem")); for( set [email protected], 0; [email protected] < [email protected]; set [email protected],[email protected]+2){ mes "^FF0000"+getitemname(getd("."+currentquest$+"_collectionitem["[email protected] +"]"))+" - "+countitem(getd("."+currentquest$+"_collectionitem["[email protected]+"]"))+"/"+getd("."+currentquest $+"_collectionitem["+([email protected]+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." +currentquest$+"_collectionprize"))?getitemname(getd ("." +currentquest$+"_collectionprize"))+" - "+getd("." +currentquest$+"_collectionamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." +currentquest$+"_collectionzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." +currentquest$+"_collectionexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." +currentquest$+"_collectionexp["+1+"]")+"^000000"; next; if(select("Finish:Abort") == 2){ mes "[^FF7700Questboard^000000]"; mes "Quest aborted."; set currentquest$, ""; set c_run, false; close; } goto L_checkitems; } if(h_run==true){ mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + currentquest$ + "_huntingname$")+"^000000"; mes "--------------------------------"; set [email protected], getarraysize(getd("."+ currentquest$ + "_huntingmob")); for( set [email protected], 0; [email protected] < [email protected]; set [email protected],[email protected]+2){ set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]"); mes "^FF0000"+strmobinfo(1,getd("."+currentquest$+"_huntingmob["[email protected]+"]"))+" - "+getd(currentquest$+"_"[email protected]+"_"+([email protected]+1)+"_killcount")+"/"+getd("."+currentquest$ +"_huntingmob["+([email protected]+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." +currentquest$+"_huntingprize"))?getitemname(getd("." +currentquest$+"_huntingprize"))+" - "+getd("." +currentquest$+"_huntingamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." +currentquest$+"_huntingzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." +currentquest$+"_huntingexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." +currentquest$+"_huntingexp["+1+"]")+"^000000"; next; if(select("Finish:Abort") == 2){ mes "[^FF7700Questboard^000000]"; mes "Quest aborted."; for(set [email protected], 1; [email protected] < [email protected]; set [email protected],[email protected]+2){ set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]"); setd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount", 0); } set currentquest$, ""; set h_run, false; close; } goto L_checkmobs; } mes "[^FF7700Questboard^000000]"; mes "Select category:"; next; switch(select((.collection)?"Collection Quests":"", (.hunting)?"Hunting Quests":"", "Exit")) { case 1: set [email protected]$, ""; for( set [email protected],0; [email protected] < .collectionquestcount; set [email protected],[email protected]+1){ if ([email protected]) set [email protected]$,[email protected]$+":"; set [email protected]$, [email protected]$ + "[" + getd("." +([email protected] +1)+"_collectionmin") + " - " + getd("." +([email protected]+1)+"_collectionmax") + "] " + getd("." + ([email protected]+1) + "_collectionname$"); } set [email protected],select([email protected]$); if(.quest_repeat == true){ if(gettimetick(2) < getd([email protected] + "_collection_delay")){ set [email protected]_left, getd([email protected] + "_collection_delay")-gettimetick (2); mes "[^FF7700Questboard^000000]"; mes "You have to wait ^0000FF"+Time2Str([email protected]_left)+"^000000 to do this quest again."; close; } } else{ if(getd([email protected] + "_collection_repeat") == true){ mes "[^FF7700Questboard^000000]"; mes "You already did this quest."; mes "Please choose another one."; close; } } mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + [email protected] + "_collectionname$")+"^000000"; mes "--------------------------------"; set [email protected], getarraysize(getd("."+ [email protected] + "_collectionitem")); for( set [email protected], 0; [email protected] < [email protected]; set [email protected],[email protected]+2){ mes "^FF0000"+getitemname(getd("."[email protected]+"_collectionitem["[email protected]+"]"))+" - "+getd("."[email protected]+"_collectionitem["+([email protected]+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." [email protected]+"_collectionprize"))?getitemname(getd("." [email protected]+"_collectionprize"))+" - "+getd("." [email protected]+"_collectionamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." [email protected]+"_collectionzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." [email protected]+"_collectionexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." [email protected]+"_collectionexp["+1+"]")+"^000000"; next; if(select("Accept:Decline") == 2){ close; } if(BaseLevel >= getd("." [email protected]+"_collectionmin") && BaseLevel <= getd("." [email protected]+"_collectionmax")){ mes "[^FF7700Questboard^000000]"; mes "Quest accepted."; set c_run, true; set currentquest$, [email protected]; close; } else{ mes "[^FF7700Questboard^000000]"; mes "You don't have the required"; mes "level to do this quest."; close; } case 2: set [email protected]$, ""; for( set [email protected],0; [email protected] < .huntingquestcount; set [email protected],[email protected]+1){ if ([email protected]) set [email protected]$,[email protected]$+":"; set [email protected]$, [email protected]$ + "[" + getd("." +([email protected]+1)+"_huntingmin") + " - " + getd("." +([email protected]+1)+"_huntingmax") + "] " + getd("." + ([email protected]+1) + "_huntingname$"); } set [email protected],select([email protected]$); if(.quest_repeat == true){ if(gettimetick(2) < getd([email protected] + "_hunting_delay")){ set [email protected]_left, getd([email protected] + "_hunting_delay")-gettimetick(2); mes "[^FF7700Questboard^000000]"; mes "You have to wait ^0000FF"+Time2Str([email protected]_left)+"^000000 to do this quest again."; close; } } else{ if(getd([email protected] + "_hunting_repeat") == true){ mes "[^FF7700Questboard^000000]"; mes "You already did this quest."; mes "Please choose another one."; close; } } mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + [email protected] + "_huntingname$")+"^000000"; mes "--------------------------------"; set .[email protected], getarraysize(getd("."+ [email protected] + "_huntingmob")); for( set [email protected], 0; [email protected] < [email protected]; set [email protected],[email protected]+2){ mes "^FF0000"+strmobinfo(1,getd("."[email protected]+"_huntingmob["[email protected]+"]"))+" - "+getd("."[email protected]+"_huntingmob["+([email protected]+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." [email protected]+"_huntingprize"))?getitemname(getd("." [email protected]+"_huntingprize"))+" - "+getd("." [email protected]+"_huntingamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." [email protected]+"_huntingzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." [email protected]+"_huntingexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." [email protected]+"_huntingexp["+1+"]")+"^000000"; next; if(select("Accept:Decline") == 2){ close; } if(BaseLevel >= getd("." [email protected]+"_huntingmin") && BaseLevel <= getd("." [email protected]+"_huntingmax")){ mes "[^FF7700Questboard^000000]"; mes "Quest accepted."; set h_run, true; set currentquest$, [email protected]; close; } else{ mes "[^FF7700Questboard^000000]"; mes "You don't have the required"; mes "level to do this quest."; close; } case 3: close; } L_checkitems: set [email protected], getarraysize(getd("."+currentquest$+"_collectionitem")); for( set [email protected],0; [email protected] < [email protected]; set [email protected],[email protected]+2){ if(countitem(getd("."+currentquest$+"_collectionitem["[email protected]+"]"))>=getd ("."+currentquest$+"_collectionitem["+([email protected]+1)+"]")){ set [email protected],[email protected]+2; } } if([email protected]<[email protected]){ mes "[^FF7700Questboard^000000]"; mes "You don't have everything."; close; } for( set [email protected],0; [email protected] < [email protected]; set [email protected],[email protected]+2){ delitem getd("."+currentquest$+"_collectionitem["[email protected]+"]"),getd ("."+currentquest$+"_collectionitem["+([email protected]+1)+"]"); } mes "[^FF7700Questboard^000000]"; mes "Congratulation! Here is your Reward."; if(getd("." +currentquest$+"_collectionprize")!=0) getitem(getd("." +currentquest$ +"_collectionprize"),getd("." +currentquest$+"_collectionamount")); set Zeny,Zeny+getd("." +currentquest$+"_collectionzeny"); getexp getd("." +currentquest$+"_collectionexp["+0+"]"),getd("." +currentquest$ +"_collectionexp["+1+"]"); setd(currentquest$ + "_collection_delay"),gettimetick(2)+.quest_delay; setd(currentquest$ + "_collection_repeat"),true; set currentquest$, ""; set c_run, false; close; L_checkmobs: set [email protected], getarraysize(getd("."+currentquest$+"_huntingmob")); set [email protected], [email protected]/2; for(set [email protected], 1; [email protected] < [email protected]; set [email protected],[email protected]+2){ set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]"); if(getd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")==getd("."+currentquest$ +"_huntingmob["[email protected]+"]")){ set [email protected], [email protected]+1; if([email protected][email protected]){ goto L_checkmobs2; } continue; } goto L_checkmobs2; } L_checkmobs2: if([email protected]<[email protected]){ mes "[^FF7700Questboard^000000]"; mes "You didn't kill everything."; close; } mes "[^FF7700Questboard^000000]"; mes "Congratulation! Here is your Reward."; set [email protected], getarraysize(getd("."+currentquest$+"_huntingmob")); for(set [email protected], 1; [email protected] < [email protected]; set [email protected],[email protected]+2){ set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]"); setd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount", 0); } if(getd("." +currentquest$+"_huntingprize")!=0) getitem(getd("." +currentquest$ +"_huntingprize"),getd("." +currentquest$+"_huntingamount")); set Zeny, Zeny+getd("." +currentquest$+"_huntingzeny"); getexp getd("." +currentquest$+"_huntingexp["+0+"]"),getd("." +currentquest$+"_huntingexp ["+1+"]"); setd(currentquest$ + "_hunting_delay"),gettimetick(2)+.quest_delay; setd(currentquest$ + "_hunting_repeat"),true; set currentquest$, ""; set h_run, false; close; OnNPCKillEvent: if(h_run!=true) end; set [email protected], getarraysize(getd("."+currentquest$+"_huntingmob")); for(set [email protected], 1; [email protected] < [email protected]; set [email protected],[email protected]+2){ if(killedrid==getd("."+currentquest$+"_huntingmob["+([email protected])+"]")){ set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]"); if(getd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")<getd ("."+currentquest$+"_huntingmob["[email protected]+"]")){ setd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount", getd (currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")+1); dispbottom getd("."+currentquest$+"_huntingname$")+": ["+strmobinfo (1,[email protected])+"] ("+ getd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")+"/"+getd ("."+currentquest$+"_huntingmob["[email protected]+"]")+")"; } if(getcharid(1) != 0 && .party_support == true){ getmapxy([email protected]$,[email protected],[email protected]); set [email protected], getcharid(3); set [email protected]$, currentquest$; getpartymember getcharid(1),1; getpartymember getcharid(1),2; for(set [email protected], 0; [email protected] < [email protected]; [email protected]++){ if(isloggedin([email protected][[email protected]], [email protected][[email protected]])){ if(h_run==true && [email protected][[email protected]] != [email protected] && [email protected]$ == getvar(currentquest$, [email protected][[email protected]]) && readparam(HP, [email protected] [[email protected]]) > 0){ getmapxy([email protected]$,[email protected],[email protected],BL_PC,rid2name ([email protected][[email protected]])); if([email protected]$ == [email protected]$ && distance ([email protected],[email protected],[email protected],[email protected]) < .party_range){ set [email protected]_amt,getvar(getd ([email protected]$+"_"[email protected]+"_"[email protected]+"_killcount"), [email protected][[email protected]]); set [email protected]_goal,getd ("."[email protected]$+"_huntingmob["[email protected]+"]"); if([email protected]_amt<[email protected]_goal) { setd([email protected]$ +"_"[email protected]+"_"[email protected]+"_killcount", [email protected]_amt+1, [email protected][[email protected]]); dispbottom getd ("."[email protected]$+"_huntingname$")+": ["+strmobinfo(1,[email protected])+"] ("+([email protected]_amt +1)+"/"[email protected]_goal+")", 0xB6FF00, [email protected][[email protected]]; } } } } } } break; } } end; OnInit: waitingroom "Quest Board",0; function AddCollection; function AddHunting; //Activate/Deactivate quest categories (true/1 - activated, false/0 - deactivated) set .collection, false; set .hunting, true; //Quest Delay (seconds) //24 hours = 86400 seconds set .quest_delay, 0; //Activate/Deactivate repeatable quests (true/1 - activated, false/0 - deactivated) set .quest_repeat, true; //Activate/Deactivate party support (true/1 - activated, false/0 - deactivated) set .party_support, true; //Max range for party support (+- x & y coordinations) set .party_range, 25; //Checks if quests are loaded (prevents out of index) if(.questsloaded==true) end; set .questsloaded, true; //Add Collection Quests here (You can add as many required items as you want) //AddCollection("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Item ID>,<Item Amount>,...); //Add Hunting Quests here (You can add as many required mobs as you want) //AddHunting("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Monster ID>,<Monster Amount>,...); Addhunting("Mid-difficulty",1,99,7711,10,50000,50000,40000,1310,100); Addhunting("High-difficulty",1,99,7711,20,50000,100000,80000,1098,100); Addhunting("Extreme-difficulty",1,99,7711,30,100000,200000,160000,1833,100); end; function AddCollection{ set .collectionquestcount,.collectionquestcount+1; setd ("." +.collectionquestcount+"_collectionname$", getarg(0)); setd ("." +.collectionquestcount+"_collectionmin", getarg(1)); setd ("." +.collectionquestcount+"_collectionmax", getarg(2)); setd ("." +.collectionquestcount+"_collectionprize", getarg(3)); setd ("." +.collectionquestcount+"_collectionamount", getarg(4)); setd ("." +.collectionquestcount+"_collectionzeny", getarg(5)); set [email protected], 6; set [email protected], getarraysize(getd("."+ .collectionquestcount + "_collectionexp")); setd ("." +.collectionquestcount+"_collectionexp["[email protected]+"]",getarg([email protected])); setd ("." +.collectionquestcount+"_collectionexp["+([email protected]+1)+"]",getarg([email protected] +1)); set [email protected], [email protected]+2; set [email protected], getarraysize(getd("."+ .collectionquestcount + "_collectionitem")); while(getarg([email protected],-1)!=-1 && getarg([email protected]+1,-1)!=-1){ setd ("."+.collectionquestcount+"_collectionitem["[email protected]+"]",getarg ([email protected])); setd ("."+.collectionquestcount+"_collectionitem["+([email protected]+1)+"]",getarg ([email protected]+1)); set [email protected],[email protected]+2; set [email protected], [email protected]+2; } return; } function AddHunting{ set .huntingquestcount,.huntingquestcount+1; setd ("." +.huntingquestcount+"_huntingname$", getarg(0)); setd ("." +.huntingquestcount+"_huntingmin", getarg(1)); setd ("." +.huntingquestcount+"_huntingmax", getarg(2)); setd ("." +.huntingquestcount+"_huntingprize", getarg(3)); setd ("." +.huntingquestcount+"_huntingamount", getarg(4)); setd ("." +.huntingquestcount+"_huntingzeny", getarg(5)); set [email protected], getarraysize(getd("."+ .huntingquestcount + "_huntingexp")); set [email protected], 6; setd ("." +.huntingquestcount+"_huntingexp["[email protected]+"]",getarg([email protected])); setd ("." +.huntingquestcount+"_huntingexp["+([email protected]+1)+"]",getarg([email protected]+1)); set [email protected], [email protected]+2; set [email protected], getarraysize(getd("."+ .huntingquestcount + "_huntingmob")); while(getarg([email protected],-1)!=-1 && getarg([email protected]+1,-1)!=-1){ setd ("."+.huntingquestcount+"_huntingmob["[email protected]+"]",getarg([email protected])); setd ("."+.huntingquestcount+"_huntingmob["+([email protected]+1)+"]",getarg([email protected] +1)); set [email protected], [email protected]+2; set [email protected], [email protected]+2; } return; } } 2. Prize Giver
    //======= 3ceam Script ======================================= //= Prize Giver NPC //===== Modified By: ========================================= //= Keitenai //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= Athena Project //===== Description: ========================================= //= Prize giver for single char, account and more. //===== Additional Comments: ================================= //= 1.0 Modified Version for 3ceam compatibility //============================================================ prontera,141,175,4 script Server Reward 113,{ //cutin "v_sprakki04",2; //Check if setups are loaded. if(!.Setup) { callsub OnLoadSetup; } //Show GM Panel if player is GM. if(getgmlevel() >= .GMin) menu("Take a prize as a player",-,"Give prize", OnManagement,"Reset Item Give", OnDelete,"IP Limit per Item", OnLimit); //Read attached player gifts from SQL table. if(select("Get Account Prize!:Get Character Prize!:Exit") == 1) { set [email protected], query_sql("SELECT * FROM `" + .GiftTableName$ + "` WHERE account_id="+getcharid(3), [email protected]_id, [email protected]_account, [email protected]_char, [email protected]_item, [email protected]_amount, [email protected]_duration, [email protected]_time ); //Account gifts. } else if(@menu == 2) { set [email protected], query_sql("SELECT * FROM `" + .GiftTableName$ + "` WHERE char_id="+getcharid(0), [email protected]_id, [email protected]_account, [email protected]_char, [email protected]_item, [email protected]_amount, [email protected]_duration, [email protected]_time ); //Char gifts. } else goto OnLeave; //Check if player don't have gifts. if([email protected]) { mes "[Reward Giver]"; mes "Sorry, you don't have any prize"; cutin "v_sprakki04",255; close; } //Build menu from query arrays. mes "[" + strnpcinfo(1) + "]"; mes "^009900You got the prize^000000"; for( set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] + 1 ) { mes "(" + [email protected]_amount[[email protected]] + ") " + getitemname([email protected]_item[[email protected]]) + "."; set [email protected]$, [email protected]$ + getitemname([email protected]_item[[email protected]]) + ":"; } next; set [email protected],select([email protected]$); //Show menu. set [email protected],[email protected]; if ([email protected]_time[[email protected]] && [email protected]_time[[email protected]] < gettimetick(2)) { mes "[Reward Giver]"; mes "Sorry, this prize's claim time is already over."; cutin "v_sprakki04",255; close; } //Item is now selected. Choose what you want to do with it. mes "[" + strnpcinfo(1) + "]"; mes "what you want do with (" + [email protected]_amount[[email protected]] + ") " + getitemname([email protected]_item[[email protected]]) + "?"; next; set [email protected],select("^009900Get it^000000:^ff0000Delete it! ^000000:nothings"); //Receive gift selected. if([email protected] == 1) { //Check weight. if(checkweight( [email protected]_item, [email protected]_amount ) || [email protected]_item[[email protected]] == .ZenyID) { mes "[" + strnpcinfo(1) + "]"; mes "^009900Get : (" + [email protected]_amount[[email protected]] + ") " + getitemname([email protected]_item[[email protected]]) + ".^000000"; if (.ip_limit) { // add ip_address to logs [email protected] = query_sql("SELECT item_id, ip_address, claim_count FROM " + .GiftTableNameIP$ + " WHERE last_ip = (SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND item_id = "[email protected]_item[[email protected]]+" LIMIT 1", [email protected],[email protected],[email protected]_count); if ([email protected]_count[0] >= .ip_limit) { next; mes "Sorry you have reached the maximum redeem limit for this IP address"; cutin "v_sprakki04",255; close; } if ([email protected]_count[0]) { query_sql("INSERT INTO " + .GiftTableNameIP$ + " (give_id,item_id,last_ip,claim_count) VALUES("[email protected]_id+","[email protected]_item+",'(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+")',1)"); } else { query_sql("UPDATE " + .GiftTableNameIP$ + " SET claim_count = "+([email protected]_count[0]+1)+" WHERE item_id = "[email protected]_item[[email protected]]+" AND last_ip = (SELECT last_ip FROM login WHERE account_id="+getcharid(3)+")"); } } if ([email protected]_item[[email protected]] == .ZenyID) { // detects zeny ID and give zeny. if ([email protected]_amount[[email protected]] > .MaxZeny) { mes "Please make sure that you have enough space to handle all these zennies and come back later."; cutin "v_sprakki04",255; close; } set Zeny,[email protected]_amount[[email protected]]; } else { if ([email protected]_duration) { getitem [email protected]_item[[email protected]], [email protected]_amount[[email protected]]; //Give item to player. } else { rentitem [email protected]_item[[email protected]], [email protected]_duration * 60; } } query_sql( "DELETE FROM `" + .GiftTableName$ + "` WHERE id = " + [email protected]_id[[email protected]] ); //Remove item from table. cutin "v_sprakki04",255; close; } else { //Overweight mes "^ff0000Sorry ^000000 You can't take it " + getitemname([email protected]_item[[email protected]]); mes "Could lose some wight?"; cutin "v_sprakki04",255; close; } } //Remove gift selected. else if([email protected] == 2) { mes "[" + strnpcinfo(1) + "]"; mes "Are you sure you want dellet it?"; mes "Gift: ("[email protected]_amount[[email protected]]+") "+getitemname([email protected]_item[[email protected]])+"."; next; if(select("Yes:No") == 1) { mes "[" + strnpcinfo(1) + "]"; mes "^ff0000Dellet: ("[email protected]_amount[[email protected]]+") "+getitemname([email protected]_item[[email protected]])+".^000000"; query_sql("DELETE FROM `" + .GiftTableName$ + "` WHERE id = " + [email protected]_id[[email protected]]); //Remove item from table. cutin "v_sprakki04",255; close; } else { mes "[" + strnpcinfo(1) + "]"; mes "we will save it"; cutin "v_sprakki04",255; close; } } //Nothing selected. else { goto OnLeave; } //GM Panel below: OnManagement: if(getgmlevel() < .GMin) goto OnLeave; mes "[" + strnpcinfo(1) + "]"; mes "Welvome " + strcharinfo(0) + "!"; mes "How I can help you?"; next; if(select("Make Gift:Nothing") != 1) goto OnLeave; //Make new gift. mes "[" + strnpcinfo(1) + "]"; mes "Please input the item id."; mes "Default: 501"; next; mes "What do you want to give?"; set [email protected],0; if(select("Item:Zeny") == 1) { input [email protected]_item, 501, 30000; } next; mes "Do you want to add a claim timer?"; if(select("No:Yes")==2) { next; mes "How many minutes do you want this reward to be claimable?"; input([email protected]); [email protected] = gettimetick(2)+([email protected]*60); } if(select("Continue:Cancel") != 1) goto OnLeave; mes "[" + strnpcinfo(1) + "]"; mes "How many items/zeny?"; mes "Default: 1"; next; //item quantity range of 1 to 1,000. if([email protected]) { input [email protected]_value, 1, .MaxZeny; } else { input [email protected]_value, 1, 1000; } if(select("Continue:Cancel") != 1) goto OnLeave; mes "[" + strnpcinfo(1) + "]"; mes "Please select input type:"; mes "1. Single Account"; mes "2. Single Character"; mes "3. All ^009900Online^000000 Accounts."; mes "4. All Accounts."; mes "5. All ^009900Online^000000 Players/Characters."; mes "6. All Players/Characters."; mes "7. ^ff0000Cancel.^000000"; next; switch(select("Single Account:Single Character:^009900Online^000000 Accounts:All Accounts:^009900Online^000000 Characters:All Characters:Cancel")) { //Account gift case 1: mes "[" + strnpcinfo(1) + "]"; mes "Please select input type:"; mes "By AID or Name?"; next; if(select("Account ID:Character Name") == 1) { mes "[" + strnpcinfo(1) + "]"; mes "Write account id:"; next; input [email protected]_account, 2000000, 10000000; //Account id range from 2m to 10m. set [email protected], query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE account_id = " + [email protected]_account, [email protected]_account); if([email protected]) goto OnNotExist; if(select("Continue:Cancel") != 1) goto OnLeave; mes "[" + strnpcinfo(1) + "]"; mes "^009900Gift is ready to go!^000000"; mes "AID: ^ff0000" + [email protected]_account + "^000000"; mes "------------------"; mes "Item: ^ff0000" + getitemname([email protected]_item) + "^000000"; mes "Quantity: ^ff0000" + [email protected]_value + "^000000"; mes "Duration: " + [email protected] + " Minutes"; mes "Claim Time: " + [email protected] + " Minutes"; next; if(select("Send Gift:Cancel") != 1) goto OnLeave; mes "[" + strnpcinfo(1) + "]"; mes "Gift sending success!"; //Create gift. <auto_id>, <account_id> <char_id> <item> <value> query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + [email protected]_account + ", " + [email protected]_item + ", " + [email protected]_value + ", " + [email protected] + ", " + [email protected] + ")"); } else { mes "[" + strnpcinfo(1) + "]"; mes "Write player name:"; next; input [email protected]_name$; set [email protected], query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE name = '" + [email protected]_name$ + "'", [email protected]_account); if([email protected]) goto OnNotExist; if(select("Continue:Cancel") != 1) goto OnLeave; mes "[" + strnpcinfo(1) + "]"; mes "^009900Gift is ready to go!^000000"; mes "AID: ^ff0000" + [email protected]_account + "^000000"; mes "Name: ^ff0000"+ [email protected]_name$ + "^000000"; mes "------------------"; mes "Item: ^ff0000" + getitemname([email protected]_item) + "^000000"; mes "Quantity: ^ff0000" + [email protected]_value + "^000000"; mes "Duration: " + [email protected] + " Minutes"; mes "Claim Time: " + [email protected] + " Minutes"; next; if(select("Send Gift:Cancel") != 1) goto OnLeave; //Check if player is logged in. if(isloggedin([email protected]_account)) { mes "[" + strnpcinfo(1) + "]"; mes "Gift sending success!"; query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + [email protected]_account + ", " + [email protected]_item + ", " + [email protected]_value + ", " + [email protected] + ", " + [email protected] + ")"); } else { //Account was not online. mes "[" + strnpcinfo(1) + "]"; mes "Gift sending success!"; query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + [email protected]_account + ", " + [email protected]_item + ", " + [email protected]_value + ", " + [email protected] + ", " + [email protected] + ")"); // duplicate to other menus - continue here on giver side } } break; //Character gift. case 2: mes "[" + strnpcinfo(1) + "]"; mes "Please select input type:"; mes "By CID or Name?"; next; if(select("Character ID:Character Name") == 1) { mes "[" + strnpcinfo(1) + "]"; mes "Write character id:"; next; input [email protected]_char,150000, 10000000; //Char id range from 150k to 10m. set [email protected], query_sql("SELECT account_id, name FROM `" + .CharTableName$ + "` WHERE char_id = " + [email protected]_char, [email protected]_accountid, [email protected]_name$); if([email protected]) goto OnNotExist; if(select("Continue:Cancel") != 1) goto OnLeave; mes "[" + strnpcinfo(1) + "]"; mes "^009900Gift is ready to go!^000000"; mes "CID: ^ff0000" + [email protected]_char + "^000000"; mes "Name: ^ff0000" + [email protected]_name$ + "^000000"; mes "------------------"; mes "Item: ^ff0000" + getitemname([email protected]_item) + "^000000"; mes "Quantity: ^ff0000" + [email protected]_value + "^000000"; mes "Duration: " + [email protected] + " Minutes"; mes "Claim Time: " + [email protected] + " Minutes"; next; if(select("Send Gift:Cancel") != 1) goto OnLeave; //Check if player is logged in. if(isloggedin([email protected]_accountid)) { mes "[" + strnpcinfo(1) + "]"; mes "Gift sending success!"; //Create gift. <auto_id>, <account_id> <char_id> <item> <value> query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + [email protected]_char + ", " + [email protected]_item + ", " + [email protected]_value + "," + [email protected] + "," + [email protected] + ")"); } else { //not online ask if we still give the gift. mes "[" + strnpcinfo(1) + "]"; mes "The character is not online!"; mes "Would you still like to send the gift?"; next; if(select("Yes:No") != 1) goto OnLeave; mes "[" + strnpcinfo(1) + "]"; mes "Gift sending success!"; //Create gift. <auto_id>, <account_id> <char_id> <item> <value> query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + [email protected]_char + ", " + [email protected]_item + ", " + [email protected]_value + "," + [email protected] + "," + [email protected] + ")"); } } else { mes "[" + strnpcinfo(1) + "]"; mes "Write player name:"; next; input [email protected]_name$; set [email protected], query_sql("SELECT char_id, account_id FROM `" + .CharTableName$ + "` WHERE name = '" + [email protected]_name$ + "'", [email protected]_char, [email protected]_accountid); if([email protected]) goto OnNotExist; if(select("Continue:Cancel") != 1) goto OnLeave; mes "[" + strnpcinfo(1) + "]"; mes "^009900Gift is ready to go!^000000"; mes "CID: ^ff0000" + [email protected]_char + "^000000"; mes "Name: ^ff0000"+ [email protected]_name$ + "^000000"; mes "------------------"; mes "Item: ^ff0000" + getitemname([email protected]_item) + "^000000"; mes "Quantity: ^ff0000" + [email protected]_value + "^000000"; mes "Duration: " + [email protected] + " Minutes"; mes "Claim Time: " + [email protected] + " Minutes"; next; if(select("Send Gift:Cancel") != 1) goto OnLeave; //Check if player is logged in. if(isloggedin([email protected]_accountid)) { mes "[" + strnpcinfo(1) + "]"; mes "Gift sending success!"; query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + [email protected]_char + ", " + [email protected]_item + ", " + [email protected]_value + "," + [email protected] + "," + [email protected] + ")"); } else { //not online ask if we still give the gift. mes "[" + strnpcinfo(1) + "]"; mes "The character is not online!"; mes "Would you still like to give the gift?"; next; if(select("Yes:No") != 1) goto OnLeave; mes "[" + strnpcinfo(1) + "]"; mes "Gift sending success!"; //Create gift. <auto_id>, <account_id> <char_id> <item> <value> query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + [email protected]_char + ", " + [email protected]_item + ", " + [email protected]_value + "," + [email protected] + "," + [email protected] + ")"); } } announce strcharinfo(0)+" successfully sent " + [email protected]_value + "x " + getitemname([email protected]_item) + " to " + [email protected]_name$,bc_all; break; //Register gift to all online accounts! case 3: mes "[" + strnpcinfo(1) + "]"; mes "^009900Gift is ready to go!^000000"; mes "Item: ^ff0000" + getitemname([email protected]_item) + "^000000"; mes "Quantity: ^ff0000" + [email protected]_value + "^000000"; mes "Duration: " + [email protected] + " Minutes"; mes "Claim Time: " + [email protected] + " Minutes"; next; if(select("Send Gift:Cancel") != 1) goto OnLeave; mes "[" + strnpcinfo(1) + "]"; mes "Please hold..."; set [email protected], 0; //Counting success. set [email protected], query_sql("SELECT account_id FROM `"+.CharTableName$+"` WHERE online=1",[email protected]); for(set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] + 1) { sleep2 25; //Slowdown the loop abit. [email protected] = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE account_id = "[email protected][[email protected]]+"", [email protected]_id, [email protected]_id); // check if in the table if ([email protected]) { query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + [email protected][[email protected]] + ", " + [email protected]_item + ", " + [email protected]_value + ", " + [email protected] + ", " + [email protected] + ")"); } } mes "Gift registered to (" + [email protected] + ") accounts!"; break; //Register gift to all accounts! case 4: mes "[" + strnpcinfo(1) + "]"; mes "^009900Gift is ready to go!^000000"; mes "Item: ^ff0000" + getitemname([email protected]_item) + "^000000"; mes "Quantity: ^ff0000" + [email protected]_value + "^000000"; mes "Claim Time: " + [email protected] + " Minutes"; next; if(select("Send Gift:Cancel") != 1) goto OnLeave; mes "[" + strnpcinfo(1) + "]"; mes "Please hold..."; set [email protected], query_sql("SELECT account_id FROM `"+.LoginTableName$+"`",[email protected]); for(set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] + 1) { sleep2 25; //Slowdown the loop abit. query_sql("INSERT INTO `" + .GiftTableName$ + "` (account_id, item, value, duration, timestamp) VALUES(" + [email protected][[email protected]] + ", " + [email protected]_item + ", " + [email protected]_value + ", " + [email protected] + ", " + [email protected] + ")"); } mes "Gift registered to (" + [email protected] + ") accounts!"; break; //Register gift to all online characters! case 5: mes "[" + strnpcinfo(1) + "]"; mes "^009900Gift is ready to go!^000000"; mes "Item: ^ff0000" + getitemname([email protected]_item) + "^000000"; mes "Quantity: ^ff0000" + [email protected]_value + "^000000"; mes "Claim Time: " + [email protected] + " Minutes"; next; if(select("Send Gift:Cancel") != 1) goto OnLeave; mes "[" + strnpcinfo(1) + "]"; mes "Please hold..."; set [email protected], 0; //Counting success. set [email protected], query_sql("SELECT char_id FROM `"+.CharTableName$+"` WHERE online=1",[email protected]); for(set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] + 1) { sleep2 25; //Slowdown the loop abit. [email protected] = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE char_id = "[email protected][[email protected]]+"", [email protected]_id, [email protected]_id); // check if in the table if ([email protected]) { query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + [email protected][[email protected]] + ", " + [email protected]_item + ", " + [email protected]_value + "," + [email protected] + "," + [email protected] + ")"); } } mes "Gift registered to (" + [email protected] + ") players!"; break; //Register gift to all characters! case 6: mes "[" + strnpcinfo(1) + "]"; mes "^009900Gift is ready to go!^000000"; mes "Item: ^ff0000" + getitemname([email protected]_item) + "^000000"; mes "Quantity: ^ff0000" + [email protected]_value + "^000000"; mes "Claim Time: " + [email protected] + " Minutes"; next; if(select("Send Gift:Cancel") != 1) goto OnLeave; mes "[" + strnpcinfo(1) + "]"; mes "Please hold..."; set [email protected], query_sql("SELECT char_id FROM `"+.CharTableName$+"`",[email protected]); for(set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] + 1) { sleep2 25; //Slowdown the loop abit. query_sql("INSERT INTO `" + .GiftTableName$ + "` (char_id, item, value, duration, timestamp) VALUES (" + [email protected][[email protected]] + ", " + [email protected]_item + ", " + [email protected]_value + "," + [email protected] + "," + [email protected] + ")"); } mes "Gift registered to (" + [email protected] + ") players!"; break; //Cancel. Default: mes "[Reward Giver]"; mes "See you later"; break; } close; OnLeave: mes "[Reward Giver]"; mes "See you later"; cutin "v_sprakki04",255; close; OnNotExist: mes "[" + strnpcinfo(1) + "]"; mes "This account does not exist!"; cutin "v_sprakki04",255; close; //============Reset Function========================= OnDelete: mes "Which gifts do you want to reset?"; mes "1. Single Account"; mes "2. Single Character"; mes "3. All ^009900Online^000000 Accounts."; mes "4. All Accounts."; mes "5. All ^009900Online^000000 Players/Characters."; mes "6. All Players/Characters."; mes "7. All cancel"; switch(select("Single Account:Single Character:^009900Online^000000 Accounts:All Accounts:^009900Online^000000 Characters:All Characters:Specific Item:IPLimit Logs:Cancel")) { case 1: //Single Account mes "[" + strnpcinfo(1) + "]"; mes "Please select input type:"; mes "By AID or Name?"; next; if(select("Account ID:Character Name") == 1) { mes "[" + strnpcinfo(1) + "]"; mes "Write account id:"; next; input [email protected]_account, 2000000, 10000000; //Account id range from 2m to 10m. set [email protected], query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE account_id = " + [email protected]_account, [email protected]_account); if([email protected]) goto OnNotExist; if(select("Continue:Cancel") != 1) goto OnLeave; query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id = " + [email protected]_account); } else { mes "[" + strnpcinfo(1) + "]"; mes "Write player name:"; next; input [email protected]_name$; set [email protected], query_sql("SELECT account_id FROM `" + .CharTableName$ + "` WHERE name = '" + [email protected]_name$ + "'", [email protected]_account); if([email protected]) goto OnNotExist; if(select("Continue:Cancel") != 1) goto OnLeave; query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id = " + [email protected]_account); } break; case 2: //Single Character mes "[" + strnpcinfo(1) + "]"; mes "Please select input type:"; mes "By CID or Name?"; next; if(select("Character ID:Character Name") == 1) { mes "[" + strnpcinfo(1) + "]"; mes "Write character id:"; next; input [email protected]_char,150000, 10000000; //Char id range from 150k to 10m. set [email protected], query_sql("SELECT account_id, name FROM `" + .CharTableName$ + "` WHERE char_id = " + [email protected]_char, [email protected]_accountid, [email protected]_name$); if([email protected]) goto OnNotExist; if(select("Continue:Cancel") != 1) goto OnLeave; query_sql("DELETE FROM " + .GiftTableName$ + " WHERE char_id = " + [email protected]_char); } else { mes "[" + strnpcinfo(1) + "]"; mes "Write player name:"; next; input [email protected]_name$; set [email protected], query_sql("SELECT char_id, account_id FROM `" + .CharTableName$ + "` WHERE name = '" + [email protected]_name$ + "'", [email protected]_char, [email protected]_accountid); if([email protected]) goto OnNotExist; if(select("Continue:Cancel") != 1) goto OnLeave; query_sql("DELETE FROM " + .GiftTableName$ + " WHERE char_id = " + [email protected]_char); } break; case 3: //All Online Accounts. mes "[" + strnpcinfo(1) + "]"; mes "Please hold..."; set [email protected], 0; //Counting success. set [email protected], query_sql("SELECT account_id FROM `"+.CharTableName$+"` WHERE online=1",[email protected]); for(set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] + 1) { sleep2 25; //Slowdown the loop abit. query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id = " + [email protected][[email protected]]); } break; case 4: //All Accounts. query_sql("DELETE FROM " + .GiftTableName$ + " WHERE account_id >= 1"); break; case 5: //All Online Players/Characters. mes "[" + strnpcinfo(1) + "]"; mes "Please hold..."; set [email protected], 0; //Counting success. set [email protected], query_sql("SELECT char_id FROM `"+.CharTableName$+"` WHERE online=1",[email protected]); for(set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] + 1) { sleep2 25; //Slowdown the loop abit. query_sql("DELETE FROM " + .GiftTableName$ + " WHERE char_id = " + [email protected][[email protected]]); } break; case 6: //All Players/Characters. query_sql("TRUNCATE TABLE " + .GiftTableName$); break; case 7: // Delete specific item mes "Please type the id of the item you wish to delete"; mes "This will delete all entries with the item id you typed"; input([email protected]); next; mes "Are you sure you want to delete all entries of " + [email protected]; if (select("Yes:No")==1) { query_sql("DELETE FROM " + .GiftTableName$ + " WHERE item = " + [email protected] + ""); } else { mes "Deletion cancelled"; close; } case 8: //All ip logs query_sql("TRUNCATE TABLE " + .GiftTableNameIP$); break; default: break; } next; mes "deletion finished"; cutin "v_sprakki04",255; close; OnLimit: mes "Please enter an ip limit, current limit is " + .ip_limit; input(.ip_limit); mes "Done!"; cutin "v_sprakki04",255; close; //============================================================ // Config/Edit: //============================================================ OnLoadSetup: set .Setup, 1; //OnInit is loaded check. set .GMin, 60; //Minimum GM level to use gm panel. set .ZenyID,23500; // put this when asked for which item to give zeny. set .MaxZeny,1000000000; //Your table names: set .CharTableName$, "char"; //Character table name(SQL). set .LoginTableName$, "login"; set .GiftTableName$, "reward"; //Gift table name(SQL). set .GiftTableNameIP$, "reward_ip"; //Gift table name for ip tracker set $GiftTableNameAT$, "reward_at"; //Gift table name for auto trade tracker //Create gift table <auto_id>, <account_id>, <char_id>, <item>, <value> query_sql("CREATE TABLE IF NOT EXISTS `reward` (`id` int(11) NOT NULL AUTO_INCREMENT,`account_id` int(11) unsigned NOT NULL DEFAULT '0',`char_id` int(11) unsigned NOT NULL DEFAULT '0',`item` int(11) NOT NULL DEFAULT '0',`value` int(11) NOT NULL DEFAULT '0',`duration` int(11) NOT NULL DEFAULT '0',`timestamp` int(23) NOT NULL DEFAULT '0',PRIMARY KEY (`id`))"); query_sql("CREATE TABLE IF NOT EXISTS `reward_ip` ( `give_id` int(11) NOT NULL, `item_id` int(11) NOT NULL, `ip_address` varchar(23) NOT NULL, `claim_count` int(11) NOT NULL, PRIMARY KEY (`give_id`))"); query_sql("CREATE TABLE IF NOT EXISTS `reward_at` (`account_id` int(11) NOT NULL,`char_id` int(11) NOT NULL)"); return; OnInit: waitingroom "Prize Giver",0; callsub OnLoadSetup; end; } /* Manual table update for at tracker CREATE TABLE IF NOT EXISTS `reward_at` ( `account_id` int(11) NOT NULL, `char_id` int(11) NOT NULL ); */ - script anti_trader -1,{ OnInit: .is_anti_trade = 1; // 0 to disable end; } function script PG_30Seconds { //dispbottom "anti trader 30sec"; //Check if Vending (normal or @at) if(checkvending() >= 1) { // mark as auto trader [email protected] = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE account_id = "+getcharid(3)+"", [email protected]_id, [email protected]_id); // check if in the table if ([email protected]) { // add if not there yet query_sql("INSERT INTO "+$GiftTableNameAT$+"(account_id,char_id) VALUES("+getcharid(3)+","+getcharid(0)+")"); //dispbottom "you have been marked as auto trader"; stopnpctimer; detachnpctimer; end; } } return; } function script PG_Login { //dispbottom "at delete"; [email protected] = query_sql("SELECT account_id, char_id FROM "+$GiftTableNameAT$+" WHERE account_id = "+getcharid(3)+"", [email protected]_id, [email protected]_id); // check if in the table if ([email protected]) { // remove to reverify vending status query_sql("DELETE FROM "+$GiftTableNameAT$+" WHERE account_id = "+getcharid(3)+""); } } I only put Waitingroom due to the fact that your request for announcement is not precise or accurate. doesn't even know when you want to announce or what to announce..

    As i've seen that you always Request for Waitingrooms.. you can do it by Looking for the OnInit of the script and add the line waitingroom.. if there's no OnInit, you can create one and add the OnInit: waitingroom end;
  12. Haruka Mayumi's post in Bug Skill Acid Demonstration miss was marked as the answer   
    Fix
  13. Haruka Mayumi's post in How to put announce on this script was marked as the answer   
    unless you want players to get the items for free.. go ahead and use it. ^_~

    Go to this Line.. 
    for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1) getitem @bought_nameid[@i],@bought_quantity[@i]; and change it into this
    for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1){ getitem @bought_nameid[@i],@bought_quantity[@i]; announce strcharinfo(0)+" has bought "[email protected]_quantity[@i]+"x "+getitemname(@bought_nameid[@i])+".",bc_all; }  
  14. Haruka Mayumi's post in some part of skin not working properly was marked as the answer   
    as far as i know, /basic_interface/shortitem_bg.bmp is for old clients and it looks like you are using 2018 client.
    you can see the interface in /shortcut/shortcut_frame.bmp
  15. Haruka Mayumi's post in Real time timer on script was marked as the answer   
    Here it is.
     
    prontera,155,181,5 script Sample 4_F_KAFRA1,{ if (#Crafting_Delay > gettimetick(2) && .Delay) { mes .name$; mes "I'm afraid you'll have to wait ^0055FF"+callfunc("Time2Str",#Crafting_Delay)+"^000000 before taking another mission."; close; } if (!quest_random) { quest_random = rand(1,3); mes .name$; mes "You have been assigned with a new quest."; next; } switch(quest_random) { case 1: setarray [email protected], 4001, 1; setarray [email protected], 512; setarray [email protected], 100; if (.Delay) set #Crafting_Delay, gettimetick(2)+(.Delay*3600); break; case 2: setarray [email protected], 4002, 1; setarray [email protected], 501, 502, 503; setarray [email protected], 3, 1, 2; if (.Delay) set #Crafting_Delay, gettimetick(2)+(.Delay*3600); break; case 3: setarray [email protected], 4003, 1; setarray [email protected], 512, 503; setarray [email protected], 300, 100; //set #crafting_quest,0; if (.Delay) set #Crafting_Delay, gettimetick(2)+(.Delay*3600); break; default: mes "invalid quest."; close; } mes "Quest Requirement(s):"; [email protected] = getarraysize([email protected]); for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) { mes " > "[email protected][[email protected]]+"x "+getitemname([email protected][[email protected]]); if (countitem([email protected][[email protected]]) < [email protected][[email protected]]) [email protected]++; } if ([email protected]) { next; if (select("Submit Quest", "Cancel") == 1) { for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) delitem [email protected][[email protected]], [email protected][[email protected]]; getitem [email protected][0], [email protected][1]; quest_random = 0; } } close; OnInit: set .Delay,24; // Quest delay, in hours (0 to disable). .name$ = "[ ^FF0000Craft Collector^000000 ]"; } EDIT: Please use Code Box instead of QOUTE.
  16. Haruka Mayumi's post in FluxCP Error: SQLSTATE[HY000] [2002] No route to host was marked as the answer   
    It's not recommended to stop a firewall. this will cause you a lot of problems.. and one of the problem is vulnerability on most of the DDoS Tools..
    It is much better to only allow the BlueHost IP to connect on your Server.. to do so.. you need to use this command for firewalld

    firewall-cmd --add-rich-rule 'rule family="ipv4" source address="YOUR_BLUEHOST_IP" service name="mysql" accept' --permanent

    dont forget to reload the firewall rule to take effect by simply using this command

    firewall-cmd --reload

    once done. make sure your firewalld is enabled..
  17. Haruka Mayumi's post in What is the point of alternate starting points? was marked as the answer   
    Wrong Section [ General Discussion ]. But yeah, it's good to have players meet at 1 real map, izlude is a small map and it's the starting point officially.. They made it alternate starting point because they don't want to flood this small map once their server officially starts. which means, all players will populate the map which will be hard for players to walk if there's a lot of players. something like that.
  18. Haruka Mayumi's post in Requesting one click buy shop was marked as the answer   
    prontera,155,181,5 script One-Click-Buy 94,{ if(Zeny < .Price){ message strcharinfo(0),"Not enough zeny"; end; } if(!checkweight(.Item,.Amount)){ message strcharinfo(0),"Not enough weight"; end; } Zeny -= .Price; getitem2 .Item,.Amount,1,.Upgrade,0,0,0,0,0; end; OnInit: set .Item,1201; set .Amount,1; set .Upgrade,7; set .Price,10000; waitingroom ((.Amount>1) ? .Amount+"x ":"")+((.Upgrade) ? "+"+.Upgrade+" ":"")+""+getitemname(.Item)+" "+.Price+"z",0; end; }  
  19. Haruka Mayumi's post in Mount Sprite vanishes on MVP Kills was marked as the answer   
    Fix.
  20. Haruka Mayumi's post in Need help with putting in quest items in an npc but shows jellopy only was marked as the answer   
    you can use @reloadscript once you added it. but the best way to do it is put the dummy shops above and use @reloadnpcfile.
    //===== rAthena Script ======================================= //= Euphy's Quest Shop //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.6c //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= A dynamic quest shop based on Lunar's, with easier config. //= Includes support for multiple shops & cashpoints. //= Item Preview script by ToastOfDoom. //===== Additional Comments: ================================= //= 1.0 Initial script. //= 1.2 Added category support. //= 1.3 More options and fixes. //= 1.4 Added debug settings. //= 1.5 Replaced categories with shop IDs. //= 1.6 Added support for purchasing stackables. //= 1.6a Added support for previewing costumes and robes. //= 1.6b Added 'disable_items' command. //= 1.6c Replaced function 'A_An' with "F_InsertArticle". //============================================================ // Shop NPCs -- supplying no argument displays entire menu. // callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}}; // ADD YOUR NPC HERE //============================================================ ra_temsky,102,147,5 script Misc 848,{ callfunc "qshop"; } // prontera,165,203,6 script Quest Shop#2 998,{ callfunc "qshop",1,2; } // call the shop 1 and 2 defined below // etc.. Add your Shop NPCs 'Quest Shop#XXX' here //============================================================ // Dummy shop data -- copy as needed. //============================================================ - shop qshop1 -1,909:-1 - shop qshop2 -1,909:-1 - shop qshop3 -1,909:-1 - shop qshop4 -1,909:-1 - shop qshop5 -1,909:-1 // Script Core - DO NOT DUPLICATE THIS NPC !!!!!!!!!!!!! //============================================================ - script quest_shop -1,{ function Add; function Chk; function Slot; OnInit: freeloop(1); // ----------------------------------------------------------- // Basic shop settings. // ----------------------------------------------------------- set .Announce,1; // Announce quest completion? (1: yes / 0: no) set .ShowSlot,1; // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never) set .ShowID,0; // Show item IDs? (1: yes / 0: no) set .ShowZeny,0; // Show Zeny cost, if any? (1: yes / 0: no) set .MaxStack,100; // Max number of quest items purchased at one time. // ----------------------------------------------------------- // Points variable -- optional quest requirement. // setarray .Points$[0],"<variable name>","<display name>"; // ----------------------------------------------------------- setarray .Points$[0], "#CASHPOINTS", "Cash Points"; //===================================================================================== // ------------------- ADD YOUR SHOPS NAME AND ITEMS SHOPS STARTING HERE -------------- //===================================================================================== // ----------------------------------------------------------- // Shop IDs -- to add shops, copy dummy data at bottom of file. // setarray .Shops$[1],"<Shop 1>","<Shop 2>"{,...}; // ----------------------------------------------------------- setarray .Shops$[1], "Eden Weapons", // Shop Named 1 // ----------------------------------------------------------- // Quest items -- do NOT use a reward item more than once! // Add(<shop ID>,<reward ID>,<reward amount>, // <Zeny cost>,<point cost>, // <required item ID>,<required item amount>{,...}); // ----------------------------------------------------------- // Shop 1 Add(1,5022,1,0,0,7086,1,969,10,999,40,1003,50,984,2); Add(1,5032,1,0,0,1059,250,2221,1,2227,1,7063,600); Add(1,5027,1,0,0,2252,1,1036,400,7001,50,4052,1); Add(1,5045,1,0,0,2252,1,1054,450,943,1200); // ----------------------------------------------------------- //===================================================================================== // ------------------- YOUR SHOPS AND ITEMS SHOPS HAVE BEEN ADDED --------------------- //===================================================================================== freeloop(0); set .menu$,""; for(set [email protected],1; [email protected]<=getarraysize(.Shops$); set [email protected],[email protected]+1) { set .menu$, .menu$+.Shops$[[email protected]]+":"; npcshopdelitem "qshop"[email protected],4320,4285,40190,40191,40192,40193,40194,40195,2629; } end; OnMenu: set [email protected], getarraysize(@i); if ([email protected]) set @shop_index, select(.menu$); else if ([email protected] == 1) set @shop_index, @i[0]; else { for(set [email protected],0; [email protected]<[email protected]; set [email protected],[email protected]+1) set [email protected]$, [email protected]$+.Shops$[@i[[email protected]]]+":"; set @shop_index, @i[select([email protected]$)-1]; } deletearray @i[0],getarraysize(@i); if (.Shops$[@shop_index] == "") { message strcharinfo(0),"An error has occurred."; end; } dispbottom "Select one item at a time."; callshop "qshop"[email protected]_index,1; npcshopattach "qshop"[email protected]_index; end; OnBuyItem: // [email protected][] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... } setarray [email protected][0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]); copyarray [email protected][3],getd(".q_"[email protected]_index+"_"[email protected][0]+"[0]"),getarraysize(getd(".q_"[email protected]_index+"_"[email protected][0])); set [email protected][2],[email protected][1]*[email protected][3]; if ([email protected][2] || [email protected][2] > 30000) { message strcharinfo(0),"You can't purchase that many "+getitemname([email protected][0])+"."; end; } mes "[Quest Shop]"; mes "Reward: ^0055FF"+(([email protected][2] > 1)[email protected][2]+"x ":"")+Slot([email protected][0])+"^000000"; mes "Requirements:"; disable_items; if ([email protected][4]) mes " > "+Chk(Zeny,[email protected][4]*[email protected][1])+([email protected][4]*[email protected][1])+" Zeny^000000"; if ([email protected][5]) mes " > "+Chk(getd(.Points$[0]),[email protected][5]*[email protected][1])+([email protected][5]*[email protected][1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+([email protected][5]*[email protected][1])+")^000000"; if ([email protected][6]) for(set [email protected],6; [email protected]<getarraysize([email protected]); set [email protected],[email protected]+2) mes " > "+Chk(countitem([email protected][[email protected]]),[email protected][[email protected]+1]*[email protected][1])+((.ShowID)?"{"[email protected][[email protected]]+"} ":"")+Slot([email protected][[email protected]])+" ("+countitem([email protected][[email protected]])+"/"+([email protected][[email protected]+1]*[email protected][1])+")^000000"; next; setarray @qe[1], getiteminfo([email protected][0],5), getiteminfo([email protected][0],11); if (@qe[2] > 0 && ((@qe[1] & EQP_HEAD_LOW) || (@qe[1] & EQP_HEAD_TOP) || (@qe[1] & EQP_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_TOP) || (@qe[1] & EQP_COSTUME_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_LOW) || (@qe[1] & EQP_GARMENT) || (@qe[1] & EQP_COSTUME_GARMENT))) set [email protected],1; addtimer 1000, strnpcinfo(0)+"::OnEnd"; while(1) { switch(select(" ~ Purchase ^0055FF"+getitemname([email protected][0])+"^000000:"+(([email protected] && [email protected][7])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) { case 1: if (@qe[0]) { mes "[Quest Shop]"; mes "You're missing one or more quest requirements."; close; } if (!checkweight([email protected][0],[email protected][2])) { mes "[Quest Shop]"; mes "^FF0000You need "+((([email protected][2]*getiteminfo([email protected][0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000"; close; } if ([email protected][4]) set Zeny, Zeny-([email protected][4]*[email protected][1]); if ([email protected][5]) setd .Points$[0], getd(.Points$[0])-([email protected][5]*[email protected][1]); if ([email protected][6]) for(set [email protected],6; [email protected]<getarraysize([email protected]); set [email protected],[email protected]+2) delitem [email protected][[email protected]],[email protected][[email protected]+1]*[email protected][1]; getitem [email protected][0],[email protected][2]; if (.Announce) announce strcharinfo(0)+" has created "+(([email protected][2] > 1)[email protected][2]+"x "+getitemname([email protected][0]):callfunc("F_InsertArticle",getitemname([email protected][0])))+"!",0; specialeffect2 EF_FLOWERLEAF; close; case 2: setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1; if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2]; else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2]; else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2]; else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2]; break; case 3: close; } } OnEnd: if (@qe[7]) { changelook LOOK_HEAD_BOTTOM, @qe[3]; changelook LOOK_HEAD_TOP, @qe[4]; changelook LOOK_HEAD_MID, @qe[5]; changelook LOOK_ROBE, @qe[6]; } deletearray @qe[0],8; end; function Add { if (getitemname(getarg(1)) == "null") { debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; } setarray [email protected][0],getarg(2),getarg(3),getarg(4); for(set [email protected],5; [email protected]<getargcount(); set [email protected],[email protected]+2) { if (getitemname(getarg([email protected])) == "null") { debugmes "Quest requirement #"+getarg([email protected])+" invalid (skipped)."; return; } else setarray [email protected][[email protected]],getarg([email protected]),getarg([email protected]+1); } copyarray getd(".q_"+getarg(0)+"_"+getarg(1)+"[0]"),[email protected][0],getarraysize([email protected]); npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0); return; } function Chk { if (getarg(0) < getarg(1)) { set @qe[0],1; return "^FF0000"; } else return "^00FF00"; } function Slot { set [email protected]$,getitemname(getarg(0)); switch(.ShowSlot) { case 1: if (!getitemslots(getarg(0))) return [email protected]$; case 2: if (getiteminfo(getarg(0),2) == 4 || getiteminfo(getarg(0),2) == 5) return [email protected]$+" ["+getitemslots(getarg(0))+"]"; default: return [email protected]$; } } } function script qshop { deletearray @i[0],getarraysize(@i); for(set [email protected],0; [email protected]<getargcount(); set [email protected],[email protected]+1) set @i[[email protected]],getarg([email protected]); doevent "quest_shop::OnMenu"; end; }  
  21. Haruka Mayumi's post in can anyone edit this to put how many they need to craft was marked as the answer   
    prontera,155,181,5 script YmirCoin 757,{ mes "[Ymir Coin Exchanger]"; mes "Just give me the required items and ill give you Coin of Ymir."; mes "Required Mats per ^FF0000"+getitemname(.GiveItem)+"^000000:"; for( set [email protected],0; [email protected] < getarraysize( .Item ) - 1; set [email protected],[email protected] + 2 ) mes "- ^FF0000"+.Item[[email protected]+1]+" "+getitemname(.Item[[email protected]]); next; if( select("Make ^FF0000"+getitemname( .GiveItem )+"^000000:Cancel") == 2 ) end; mes "[Ymir Coin Exchanger]"; mes "How many would you like to make?"; next; input [email protected],1,999; mes "[Ymir Coin Exchanger]"; mes [email protected]+"x ^FF0000"+getitemname(.GiveItem)+"^000000, is this correct?"; next; if( select("Yes, Make ^FF0000"[email protected]+" "+getitemname( .GiveItem )+"^000000:Cancel") == 2 ) end; for( set [email protected],0; [email protected] < getarraysize( .Item ) - 1; set [email protected],[email protected] + 2 ) if( countitem( .Item[[email protected]] ) < .Item[[email protected]+1]*[email protected] ){ mes "[Ymir Coin Exchanger]"; mes "Insufficient Materials"; for( set [email protected],0; [email protected] < getarraysize( .Item ) - 1; set [email protected],[email protected] + 2 ) mes "- Need ( "+countitem(.Item[[email protected]])+"/"+.Item[[email protected] + 1]*[email protected]+" ) "+getitemname( .Item[[email protected]] ); end; } if(!checkweight(.GiveItem,[email protected])){ mes "Insufficient inventory space or weight."; end; } for( set [email protected],0; [email protected] < getarraysize( .Item ) - 1; set [email protected],[email protected] + 2 ) delitem .Item[ [email protected] ],.Item[ [email protected] + 1 ]*[email protected]; getitem .GiveItem,[email protected]; mes "[Ymir Coin Exchanger]"; mes "You have Made ^FF0000"[email protected]+"x "+getitemname( .GiveItem )+"^000000"; announce "["+strcharinfo(0)+"] has made "[email protected]+"x ["+getitemname( .GiveItem )+"]",0; close; OnInit: // What Item you want to Make ? set .GiveItem,7539; // Item Requirements + Amounts setarray .Item[0], 607,1, 608,1, 512,1; end; } It's much better to check the requirement before giving the item, instead of before selecting MAKE. also added checkweight if ever that the given item is heavier than required materials.
  22. Haruka Mayumi's post in How to replace Coin in Extended Vending was marked as the answer   
    trunk/db/item_vending.txt
  23. Haruka Mayumi's post in Dispel works with Hidden Player was marked as the answer   
    in skill_db.txt
     
    289,9,6,1,0,0x1,0:0:0:0:0:-1,5,1,yes,0,0xE00,0,magic,0,0x10020, SA_DISPELL,Dispell change the inf3 into
    289,9,6,1,0,0x1,0:0:0:0:0:-1,5,1,yes,0,0xE00,0,magic,0,0x20, SA_DISPELL,Dispell removing this 
    //    0x010000 - skill that affects hidden targets
  24. Haruka Mayumi's post in Absorb Spirit / Dispel cancels Asura (if cast finished first) was marked as the answer   
    case KO_ZANZOU: { int c = 0; i = map_foreachinmap(skill_check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, MOBID_ZANZOU, skill_id, &c); if( c >= skill_get_maxcount(skill_id,skill_lv) || c != i) { clif_skill_fail(sd , skill_id, USESKILL_FAIL_LEVEL, 0); return false; } } break; + case MO_EXTREMITYFIST: + if( !sd->spiritball || !sd->sc.data[SC_EXPLOSIONSPIRITS]){ + clif_skill_fail(sd , skill_id, USESKILL_FAIL_LEVEL, 0); + return false; + } + break; } in skill.cpp
  25. Haruka Mayumi's post in VoteForPoint NPC only show apple was marked as the answer   
    You must declare the shop first because on the script. it read the V4P manager first and run the OnInit first..
    although its okay if you use @reloadscript to show the items. but its not the case on @reloadnpcfile.
    - shop votepoints_shop -1,512:-1 vip_lounge,140,243,4 script V4P Manager 62,{ function getPoints; set [email protected]$, "[VFP Manager]"; set [email protected], 1; // 0 = item, 1 = shop set [email protected], 501; // if settings is set to item set [email protected], 2; // 2 Vote Points for 1 Red Potion set .vp, getPoints(getcharid(3)); switch ([email protected]) { case 0: mes [email protected]$; mes "Would you like to convert your "+ .vp +" Vote Points?"; mes "^ff0000The current convert rate is "+ [email protected] +" Vote Points for 1 "+ getitemname([email protected]) +"."; next; menu "Yes", L_Convert, "No", -; mes [email protected]$; mes "Bye, then."; break; case 1: mes [email protected]$; mes "You have ^ff0000"+ .vp +"^000000 Vote Points."; mes "Would you like to go shopping?"; next; menu "Yes", -, "No", L_Goodbye; mes [email protected]$; mes "Have fun shopping!"; callshop "votepoints_shop",1; npcshopattach "votepoints_shop"; end; } L_Goodbye: mes [email protected]$; mes "Goodbye, then."; close; L_Convert: if (.vp < [email protected]) goto L_VotePointsTooLow; mes [email protected]$; mes "How much Vote Points would you like to convert?"; next; menu "All", L_ConvertAll, "Input Amount", L_ConvertAmount; L_ConvertAmount: input [email protected]; if ([email protected] > .vp) goto L_VotePointsTooLow; set .vp, ((.vp - [email protected]) + ([email protected] % [email protected])); set [email protected], ([email protected] / [email protected]); getitem [email protected], [email protected]; query_sql("UPDATE cp_createlog SET votepoints = "+ .vp +" WHERE account_id = "+ getcharid(3)); mes [email protected]$; mes "You have received "+ [email protected] +"x "+ getitemname([email protected]) +"."; mes "Your current Vote Points is "+ .vp; close; L_ConvertAll: set [email protected], (.vp / [email protected]); set .vp, (.vp % [email protected]); getitem [email protected], [email protected]; query_sql("UPDATE cp_createlog SET votepoints = "+ .vp +" WHERE account_id = "+ getcharid(3)); mes [email protected]$; mes "You have received "+ [email protected] +"x "+ getitemname([email protected]) +"."; mes "Your current Vote Points is "+ .vp; close; L_VotePointsTooLow: mes [email protected]$; mes "Your Vote Points is too low. Come back when you have the minimum amount of Vote Points."; close; function getPoints { set [email protected]_id, getarg(0); set [email protected], query_sql("SELECT votepoints FROM cp_createlog WHERE account_id = "+ [email protected]_id, [email protected]); return [email protected] ? [email protected] : 0; } OnBuyItem: set [email protected],0; for(set [email protected],0; [email protected]<getarraysize(@bought_nameid); set [email protected],[email protected]+1) for(set [email protected],0; [email protected]<getarraysize(.itemShop); set [email protected],[email protected]+2) if (@bought_nameid[[email protected]] == .itemShop[[email protected]]) { set [email protected], [email protected]+(.itemShop[[email protected]+1]*@bought_quantity[[email protected]]); break; } mes [email protected]$; if ([email protected] > .vp) mes "You don't have enough Vote Points."; else { for(set [email protected],0; [email protected]<getarraysize(@bought_nameid); set [email protected],[email protected]+1) { getitem @bought_nameid[[email protected]], @bought_quantity[[email protected]]; dispbottom "Purchased "[email protected]_quantity[[email protected]]+"x "+getitemname(@bought_nameid[[email protected]])+"."; } set .vp, .vp - [email protected]; query_sql("UPDATE cp_createlog SET votepoints = votepoints - "+ [email protected] +" WHERE account_id = "+ getcharid(3)); mes [email protected]$; mes "Deal completed."; mes "You now have ^ff0000"+ .vp +"^000000 Vote Points."; emotion et_money; } set [email protected],0; deletearray @bought_nameid[0], getarraysize(@bought_nameid); deletearray @bought_quantity[0], getarraysize(@bought_quantity); close; OnInit: setarray .itemShop[0], 501,2,607,5; // <ITEM_ID>,<PRICE>,... npcshopdelitem "votepoints_shop",512; for(set [email protected], 0; [email protected] < getarraysize(.itemShop); set [email protected], [email protected]+2) npcshopadditem "votepoints_shop", .itemShop[[email protected]], .itemShop[[email protected]+1]; end; }
×
×
  • Create New...

Important Information

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