Jump to content

Skorm

Forum Moderator
  • Posts

    1268
  • Joined

  • Last visited

  • Days Won

    33

Community Answers

  1. Skorm's post in VIP SYSTEM was marked as the answer   
    Switched the functions for the compare command because it's faster and some other things.
     
    //eAthena Version 2 prontera,150,150,5 script VIP system 56,{ function statusvip; function expirevip; function mainmenu; function showlist; function deletevip; function addvip; mes .npc_Name$; query_sql "SELECT `account_type` FROM login WHERE `account_id` = "+ getcharid(3), .@acc_Type$; while( .@i < 3 && !compare(.@acc_Type$,.type_name$[.@i]) ) set .@i, .@i +1; if( .@i == 3 ) mes "Hello "+ strcharinfo(0) +" you have an normal account. Get an "+ getitemname( .item_premium_b ) +", "+ getitemname( .item_premium_s ) +", "+ getitemname( .item_premium_g ) +" to get a premium account."; else { set .@expiration_Date$, statusvip( .type_name$[.@i], .@i +1, 1 ); mes "Hello "+ strcharinfo(0) +" you have an "+ .type_name$[.@i] +" and it will expire in "+ .@expiration_Date$; } goto L_player; OnWhisperGlobal: if ( getgmlevel() < 99 ) end; L_main: mes .npc_Name$; mes "Welcome, "+ strcharinfo(0) +"!"; mes "What can I do for you today?"; L_player: next; set .@s, select( ( getgmlevel() < 99 ? "" : "VIP bronze Menu" ), ( getgmlevel() < 99 ? "" : "VIP silver Menu" ), ( getgmlevel() < 99 ? "" : "VIP gold Menu" ), ( ( countitem( .item_premium_b ) || countitem( .item_premium_s ) || countitem( .item_premium_g ) ) && .up_npc ? "Upgrade my account" : "" ), "Quit" ) -1; if ( .@s == 4 ) close; else if( .@s == 3 ) { setarray .@rank$, "b", "s", "g"; set .@menu, (prompt("Bronze:Silver:Gold")-1); callfunc "VIP_upgrade", 7, getd(".item_premium_"+.@rank$[.@menu]), .@menu; } set .@a$, "[VIP "+ .type_name$[.@s] +"]"; next; mes .npc_Name$; mes .@a$; // if( getgmlevel() < 99 ) { // set .@sub_s, select( "List Accounts", "Cancel" ); // if( .@sub_s == 2 ) close; // mainmenu( .@sub_s +2, .@s ); // } next; set .@sub_s, select( "Add/Extend Account", "Delete Account", "List Accounts", "Back" ); if ( .@sub_s == 4 || mainmenu( .@sub_s, .@s, .@a$ ) ) goto L_main; // Setting // ------- OnInit: set .npc_Name$,"[VIP System v4.0]"; set .bronze_AccLvl, 1; // VIP bronze Account Level set .silver_AccLvl, 2; // silver set .gold_AccLvl, 3; // gold set .bronze_ExpRate, 25; // VIP bronze Exp Boost in % ( 1 = 1% ) set .silver_ExpRate, 50; // silver set .gold_ExpRate, 100; // gold set .bronze_ItemRate, 0; // VIP bronze Item Drop Boost in % ( 1 = 1% ) set .silver_ItemRate, 5; // silver set .gold_ItemRate, 10; // gold set .item_premium_b, 501; // ID item to upgrade your account to bronze set .item_premium_s, 502; // ID item to upgrade your account to silver set .item_premium_g, 503; // ID item to upgrade your account to gold set .fcp, 0; // fcp for gold vip ? (0 : no) / (1 : yes) set .up_npc, 1; // player can upgrade to npc if items required 0 : no setarray .type_name$, "bronze", "silver", "gold" ; end; // On login // -------- OnPCLoginEvent: query_sql "SELECT `account_type` FROM login WHERE `account_id` = "+ getcharid(3), .@acc_Type$; while( .@i < 3 && !compare(.@acc_Type$,.type_name$[.@i]) ) set .@i, .@i +1; if( .@i == 3 ) end; sc_end sc_expboost; sc_end sc_itemboost; set .@expiration_Date$, statusvip( .type_name$[.@i], .@i, 0 ); dispbottom "----------------------------------------------------------------------"; dispbottom "Account type: "+ .@acc_Type$; dispbottom "Expiration date: "+ .@expiration_Date$; dispbottom "----------------------------------------------------------------------"; end; // Check the VIP status ; bonus VIP // -------------------------------- function statusvip { query_sql "SELECT `status` FROM `vip_"+ getarg(0) +"` WHERE `account_id` = "+ getcharid(3), .@vip_Status$ ; query_sql "SELECT DATE_FORMAT(`end_date`, '%Y%m%d') FROM `vip_"+ getarg(0) +"` WHERE `account_id` = "+ getcharid(3), .@expiration_Date$ ; query_sql "SELECT CURDATE() + 0;", .@current_Date$ ; if( getarg(2) ) return .@expiration_Date$; if ( atoi(.@current_Date$) >= atoi(.@expiration_Date$) ) expirevip( "vip_"+ getarg(0), getcharid(3) ); else { set .@time, 3600 * 60 * 1000; set .@it_Rate, getd( "."+ getarg(0) +"_ItemRate" ); set .@exp_rate, getd( "."+ getarg(0) +"_ExpRate" ); if( .@exp_rate ) sc_start sc_expboost, .@time, .@exp_rate; if( .@it_Rate ) sc_start sc_itemboost, .@time, .@it_Rate; if( getarg(1) == 2 && .fcp ) { sc_start SC_CP_WEAPON, .@time, 5; sc_start SC_CP_SHIELD, .@time, 5; sc_start SC_CP_ARMOR, .@time, 5; sc_start SC_CP_HELM, .@time, 5; } } return .@expiration_Date$; } // VIP expire : updates tables // --------------------------- function expirevip { set .@T_Name$, getarg(0); set .@acc_Id, getarg(1); query_sql "UPDATE `login` SET `level` = 0, `account_type` = 'NORMAL' WHERE account_id = "+ .@acc_Id; query_sql "DELETE FROM "+ .@T_Name$ +" WHERE account_id = "+ .@acc_Id; query_sql "ALTER TABLE "+ .@T_Name$ +" AUTO_INCREMENT = 1"; sc_end SC_CP_WEAPON; sc_end SC_CP_SHIELD; sc_end SC_CP_ARMOR; sc_end SC_CP_HELM; dispbottom "Your VIP expire."; end; } function mainmenu { switch( getarg(0) ) { case 1: addvip( getarg(1), getarg(2) ); break; case 2: deletevip( getarg(1), getarg(2) ); break; case 3: showlist( getarg(1) ); } return 1; } function addvip { set .@s, getarg(0); set .@a$, getarg(1); mes .npc_Name$; mes .@a$; mes "Type the Account Name"; mes "you wish to add."; input .@acc_Name$; next; mes .npc_Name$; mes .@a$; query_sql "SELECT `account_id` FROM login WHERE `userid` = '"+ escape_sql( .@acc_Name$ )+"'", .@acc_Id ; mes "Identifying account: "+ .@acc_Name$ +"."; sleep2 500; if ( !.@acc_Id ) { mes "ERROR: Couldn't find account."; mes "Verify if you dind't make a typo."; close; } mes .npc_Name$; mes .@a$; mes "Type the number of days you"; mes "wish to add to the account's VIP"; mes "status."; next; while( input( .@Days, 1, 999 ) != 0 ) { mes .npc_Name$; mes .@a$; mes "Put a number between 1 and 999."; next; } mes .npc_Name$; mes .@a$; query_sql "SELECT `account_id` FROM vip_"+ .type_name$[.@s] +" WHERE `account_id` = "+ .@acc_Id, .@vip_accid; if ( .@vip_accid == .@acc_Id ) { mes "Account ID: "+ .@vip_accid +"."; sleep2 500; query_sql "UPDATE vip_"+ .type_name$[.@s] +" SET end_date = DATE_ADD(end_date, INTERVAL "+ .@Days +" DAY), `status` = 'ACTIVE' WHERE account_id = "+.@vip_accid; query_sql "UPDATE login SET `account_type` = '"+ .type_name$[.@s] +"' WHERE account_id = "+ .@vip_accid; mes "Account "+ .@acc_Id +" added successfully!"; } else { mes "Account ID: "+ .@acc_Id +"."; sleep2 500; query_sql "INSERT INTO vip_"+ .type_name$[.@s] +" (`account_id`,`account_name`,`start_date`,`end_date`,`status`) VALUES ("+.@acc_Id+",'"+ escape_sql( .@acc_Name$ ) +"',CURDATE(),CURDATE(),'ACTIVE')"; sleep2 100; query_sql "UPDATE vip_"+ .type_name$[.@s] +" SET end_date = DATE_ADD(start_date, INTERVAL "+ .@Days +" DAY) WHERE account_id = "+.@acc_Id; query_sql "UPDATE `login` SET `level` = "+ getd( "."+ .type_name$[.@s] +"_AccLvl" ) +", `account_type` = '"+ .type_name$[.@s] +"' WHERE `account_id` = "+.@acc_Id; mes "Account "+ .@acc_Id +" added successfully!"; } close; } function deletevip { set .@s, getarg(0); set .@a$, getarg(1); set .@size, query_sql( "SELECT account_name,`account_id` FROM vip_"+ .type_name$[.@s] +" LIMIT 127", .@List$, .@acc_id ); mes .npc_Name$; mes .@a$; if ( .@size == 0 ) mes "There are currently no VIP "+ .type_name$[.@s] +" accounts."; else { mes "Select the account you wish "; mes "to remove from VIP system."; set .@j$, "1. "+ .@List$; for ( set .@i, 1; .@i < .@size; set .@i, .@i + 1 ) set .@j$, .@j$ +":"+ ( .@i +1 ) +". "+ .@List$[.@i]; set .@j$, .@j$ +":Cancel"; next; mes .npc_Name$; mes .@a$; set .@menu_del, select( .@j$ ) -1; if ( .@menu_del == .@size ) { next; return; } mes "Are you sure you want to remove the account "; mes .@List$[ .@menu_del ] +" ?"; if ( select( "Yes", "No" ) -1 ) { next; return; } query_sql "UPDATE `login` SET `level` = 0, `account_type` = 'NORMAL' WHERE `account_id` = '"+ .@acc_id +"'"; query_sql "DELETE FROM vip_"+ .type_name$[.@s] +" WHERE account_id = "+ .@acc_id; query_sql "ALTER TABLE vip_"+ .type_name$[.@s] +" AUTO_INCREMENT = 1"; mes "VIP "+ .type_name$[.@s] +" account successfully deleted!."; } close; } function showlist { set .@s, getarg(0); mes .npc_Name$; mes "VIP "+ .type_name$[.@s] +" accounts list:"; set .@size, query_sql( "SELECT account_name FROM vip_"+ .type_name$[.@s] +" LIMIT 127", .@List$ ); if( .@size == 0 ) { mes "The list is empty."; close; } for ( set .@i, 0; .@i < .@size; set .@i, .@i + 1 ) mes ( .@i +1 )+". "+ .@List$[ .@i ]; close; } } // Upgrade via itemscript // ---------------------- /* callfunc( "VIP_upgrade", 7, 12703, 0 ); getarg(2) : 0 = up to bronze 1 = up to silver 2 = up to gold */ function script VIP_upgrade { if( select( "^777777~ Upgrade my account", "~ Not today^000000" ) -1 ) close; set .@acc_id, getcharid(3) ; setarray .@type_name$, "bronze", "silver", "gold" ; set .@bronze_AccLvl, 1; // VIP bronze Account Level set .@silver_AccLvl, 2; // silver set .@gold_AccLvl, 3; // gold query_sql "SELECT `userid`, `account_type` FROM `login` WHERE `account_id` = '"+ .@acc_id +"'", .@user_id$, .@acc_type$; while( .@i < 3 && !compare(.@acc_Type$,.@type_name$[.@i]) ) set .@i, .@i +1; dispbottom ""+.@i+">="+getarg(2); if ( .@i == 2 || ( .@i >= getarg(2) && .@i != 3 ) ) { dispbottom "Your can't upgrade your account."; close; } if(!countitem(getarg(1))) { message strcharinfo(0), "You don't have any "+getarg(1)+"(s)."; close; } else if( .@i != 3 ) { query_sql "DELETE FROM vip_"+ .@type_name$[.@i] +" WHERE account_id = '"+ .@acc_id +"'"; query_sql "ALTER TABLE vip_"+ .@type_name$[.@i] +" AUTO_INCREMENT = 1"; } query_sql "INSERT INTO vip_"+ .@type_name$[ getarg(2) ] +" (`account_id`,`account_name`,`start_date`,`end_date`,`status`) VALUES ("+ .@acc_id +",'"+ escape_sql( .@user_id$ ) +"', CURDATE(), ( DATE_ADD(CURDATE(), INTERVAL "+ getarg(0) +" DAY) ), 'ACTIVE') "; query_sql "UPDATE `login` SET `level` = "+ getd( ".@"+ .@type_name$[ getarg(2) ] +"_AccLvl" ) +", `account_type` = '"+ .@type_name$[getarg(2)] +"' WHERE `account_id` = '"+ .@acc_id +"'"; query_sql "SELECT DATE_FORMAT(`end_date`, '%Y %M %d') FROM vip_"+ .@type_name$[ getarg(2) ] +" WHERE `account_id` = '"+ .@acc_id +"'", .@exp_Date$; message strcharinfo(0), "Account updated. Expiration : "+ .@exp_Date$; delitem getarg(1), 1; message strcharinfo(0), "You must relog."; close2; sleep2 4000; if( playerattached() ) atcommand "@kick "+ strcharinfo(0); end; } // 12703,Holy_Egg_2,Holy Egg,11,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc( "VIP_upgrade", 7, 12703, 0 ); /* 7 days, item ID to delete */ },{},{} // 12703,Holy_Egg_2,Holy Egg,11,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc( "VIP_upgrade", 7, 12703, 1 ); /* 7 days, item ID to delete */ },{},{} // 12703,Holy_Egg_2,Holy Egg,11,0,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc( "VIP_upgrade", 7, 12703, 2 ); /* 7 days, item ID to delete */ },{},{}  
    Database bits:
    CREATE TABLE IF NOT EXISTS `vip_bronze` ( `account_id` int(11) unsigned NOT NULL default '0', `account_name` varchar(255) NOT NULL default 'NULL', `start_date` datetime NOT NULL default '0000-00-00 00:00:00', `end_date` datetime NOT NULL default '0000-00-00 00:00:00', `status` varchar(255) NOT NULL DEFAULT 'NULL', PRIMARY KEY (`account_id`) ) ENGINE=MyISAM; CREATE TABLE IF NOT EXISTS `vip_silver` ( `account_id` int(11) unsigned NOT NULL default '0', `account_name` varchar(255) NOT NULL default 'NULL', `start_date` datetime NOT NULL default '0000-00-00 00:00:00', `end_date` datetime NOT NULL default '0000-00-00 00:00:00', `status` varchar(255) NOT NULL DEFAULT 'NULL', PRIMARY KEY (`account_id`) ) ENGINE=MyISAM; CREATE TABLE IF NOT EXISTS `vip_gold` ( `account_id` int(11) unsigned NOT NULL default '0', `account_name` varchar(255) NOT NULL default 'NULL', `start_date` datetime NOT NULL default '0000-00-00 00:00:00', `end_date` datetime NOT NULL default '0000-00-00 00:00:00', `status` varchar(255) NOT NULL DEFAULT 'NULL', PRIMARY KEY (`account_id`) ) ENGINE=MyISAM; ALTER table `login` add column account_type varchar(255) NOT NULL default 'NULL' after `birthdate`, add index (account_type); UPDATE `login` SET `account_type` = 'NULL'; TRUNCATE `vip_bronze`; TRUNCATE `vip_gold`; TRUNCATE `vip_silver`;
  2. Skorm's post in Poring spawner was marked as the answer   
    http://code.google.com/p/ea-addicts/downloads/detail?name=mvpspawner.txt&can=2&q=
  3. Skorm's post in R>edit was marked as the answer   
    - script Royal Invasion -1,{
    OnClock0603:
    OnClock1757:
    setarray .@Towns$[0],"ars_fild12"; // Random town list
    set .map$, .@Towns$[rand(getarraysize(.@Towns$))];
    set .@mob, 3613; // Mob ID
    set .count, 500; // Mob count
    set .boss, 1;
    monster .map$,0,0,strmobinfo(1,.@mob),.@mob,.count,strnpcinfo(0)+"::OnMobDead";
    end;
    OnMobDead:
    set .count, .count-1;
    if (!.count) {
    set .@mob, 3622; // Boss ID
    monster .map$,0,0,strmobinfo(1,.@mob),.@mob,1,strnpcinfo(0)+"::OnMobDead2";
    }
    end;
    OnMobDead2:
    set .boss, 0;
    announce strcharinfo(0)+" Emperor's Army has been annihilated! The Rune Midgard is Safe",0;
    sleep2 20000;
    announce "All Mighty Warrior who fought the emperor will be return to their lands. The Portal is closed.", bc_all;
    atcommand "@doommap";
    end;
    OnClock0803:
    if(!.boss) end;
    announce "The boss has won and the Portal is closed!!!", bc_all;
    killmonster .map$,strnpcinfo(0)+"::OnMobDead2";
    killmonster .map$,strnpcinfo(0)+"::OnMobDead";
    set .boss, 0;
    end;
    }

  4. Skorm's post in Help with my script was marked as the answer   
    Like this?
     
    function script patienceTest { setarray .@pt_4096[0], 606,100, 914,50; // Job_Baby_Rune setarray .@pt_4097[0], 606,100, 914,50; // Job_Baby_Warlock setarray .@pt_4098[0], 606,100, 914,50; // Job_Baby_Ranger setarray .@pt_4099[0], 606,100, 914,50; // Job_Baby_Bishop setarray .@pt_4100[0], 606,100, 914,50; // Job_Baby_Mechanic setarray .@pt_4101[0], 606,100, 914,50; // Job_Baby_Cross setarray .@pt_4102[0], 606,100, 914,50; // Job_Baby_Guard setarray .@pt_4103[0], 606,100, 914,50; // Job_Baby_Sorcerer setarray .@pt_4104[0], 606,100, 914,50; // Job_Baby_Minstrel setarray .@pt_4105[0], 606,100, 914,50; // Job_Baby_Wanderer setarray .@pt_4106[0], 606,100, 914,50; // Job_Baby_Sura setarray .@pt_4107[0], 606,100, 914,50; // Job_Baby_Genetic setarray .@pt_4108[0], 606,100, 914,50; // Job_Baby_Chaser set .@jobID, getarg(0); set .@npc$, getarg(1); set .@qID, (25000+.@jobID-4030); if(Class != .@jobID || checkquest(.@qID) == 2) return; mes .@npc$; set .@j3, roclass(eaclass()|EAJL_THIRD); if (checkquest(.@qID) == 1) { mes "Have you brought the items yet?"; next; if(select("Yes:No")-1) { mes "Alright comeback when you have!"; close; } set .@invalid, 0; for(set .@i,0; .@i < getarraysize(getd(".@pt_"+ .@j3)); set .@i,.@i+2) { if(countitem(getd(".@pt_"+ .@j3 +"["+ .@i +"]")) < getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]")) { mes "- "+ getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]") +" "+ getitemname(getd(".@pt_"+ .@j3 +"["+ .@i +"]")); set .@invalid, 1; } } if(.@invalid) { mes .@npc$; mes "You are missing some items. Please come again when you have all the items I asked you to bring."; close; } mes .@npc$; mes "Congratulations~! You have completed the ^0042FFPatience Test^000000!"; mes "Now we can get started."; for(set .@i,0; .@i < getarraysize(getd(".@pt_"+ .@j3)); set .@i,.@i+2) delitem getd(".@pt_"+ .@j3 +"["+ .@i +"]"), getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]"); completequest .@qID; next; } else if (checkquest(.@qID) < 1) { mes "Good. We will start with the ^0042FFPatience Test^000000."; mes "You are still very young, which is why you must complete this task in order to prove me that you got what it takes to become one of us."; next; mes .@npc$; mes "Shall we begin then?"; next; if(select("Hold on:Yes!") == 1) { mes .@npc$; mes "You must complete the ^0042FFPatience Test^000000 in order to change your job."; mes "Let me know when you are ready."; close; } mes "Your ^0042FFPatience Test^000000 is to bring me the following items:"; for(set .@i,0; .@i < getarraysize(getd(".@pt_"+ .@j3)); set .@i,.@i+2) mes "- "+ getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]") +" "+ getitemname(getd(".@pt_"+ .@j3 +"["+ .@i +"]")); setquest .@qID; close; } return; }
  5. Skorm's post in Help on dynamic menu was marked as the answer   
    There are a few different ways of doing a dynamic menu.
     
    set .@req$, "|1599|1201|"; //Items required. setarray .@eq$, "Upper Headear", "Armor" , "Left hand" , "Right hand" , "Garment", "Footgear", "Accessory 1", "Accessory 2", "Middle Headgear", "Lower Headgear"; set .@len, getarraysize(.@eq$); //Array size. set .@menu$, implode(.@eq$,":"); //Menu npctalk "Where is the item equipped?"; select(.@menu$); //Setting the choice @menu. set .@eq_itm, getequipid(@menu); //Equipped slot to ID. if(!compare(.@req$,"|"+.@eq_itm+"|")) //Comparing Equipped item to required items! npctalk "No that's not the item!"; else npctalk "Awesome you got it!"; end; This is an example where the menu isn't so dynamic but your options are limited to one of multiple required items without loops etc.
     
     
    setarray .@con, 501, 502 ,503, 504, 505; //Required List. set .@len, getarraysize(.@con); //Length of list. while(.@i++-1<.@len) set .@menu$, getitemname(.@con[.@i-1])+":"; //Creating the menu. set .@sel, select(.@menu$)-1; //Select from the menu and reduce the selection by one so it will match our array. if(!countitem(.@con[.@sel])) //Get the ID from our array with the players selection, and use it to see if the item exists. npctalk "You don't have "+getitemname(.@con[.@sel])+"."; else getitem(.@con[.@sel],1); end; In this example you match the array with the selected menu... If the menu and the array are the same we can grab and use items from the array as our players selection.
     

     
    If you mean using case conditions they really aren't very flexible, but they do work well for database type situations where the information can be individually set for each item.
     
    function script Monster_DB { switch(getarg(0)){ case 1002: switch(getarg(1)){ // Keep in mind these are precents overall so 20% is actually lower while 140% is actually 40% higher. // Where 200% is double... It's like saying 2*400=800. case 0: // Heal Item Rate (Healing Items) return 20; // 20% for healing items. case 2: case 7: case 11: case 18: // Uasable Item Rate (Anything Usable that doesn't heal) return 100; // 100% for healing items. case 3: // Common Item Rate (ETC) return 200; //200% more for Common Items. case 4: case 5: case 8: case 10: // Equip Item Rate (Ammo, Pet Equip, Weapon, Armor) return 140; // 140% more for equip items. case 6: // Card Item Rate (Card) return 200; // 110% more for cards. } case 1003: case 1004: case 1005: //...to add new monsters simply do as I've done. } } Where 1002(getarg(0)) is the mob ID and number 0-6(getarg(1)) are dropped item types.
     
    You can view the full script here.
    http://code.google.com/p/ea-addicts/downloads/detail?name=dropemulator.txt&can=2&q=
     
    I hope this helps.
  6. Skorm's post in Simple Poring Coin Shop was marked as the answer   
    - shop custom_seller2 -1,501:20 prontera.gat,95,99,5 script Poring Coin Shop 100,{ mes "I will sell you items for " + getitemname(.CoinID) + "."; callshop "custom_seller2",1; npcshopattach "custom_seller2"; end; OnBuyItem: for(set .@i,0; .@i<getarraysize(.customs); set .@i,.@i+1) { for(set .@d,0; .@d<getarraysize(@bought_nameid); set .@d,.@d+1) { if(@bought_nameid[.@d]==.customs[.@i]) { if(checkweight(@bought_nameid[.@d],@bought_quantity[.@d])) { if(countitem(.CoinID) >= .Price[.@i]*@bought_quantity[.@d]) { delitem .CoinID,.Price[.@i]*@bought_quantity[.@d]; getitem @bought_nameid[.@d],@bought_quantity[.@d]; } else dispbottom "You don't have enough "+getitemname(.CoinID)+" to purchase that item."; } else dispbottom "Purchasing these items will put you over the weight limit!"; } } } deletearray @bought_quantity, getarraysize(@bought_quantity); deletearray @bought_nameid, getarraysize(@bought_nameid); close; OnInit: setarray .customs[0],12103,607,678;// Enter the ID of customs here set .CoinID,7539; // Enter the ID of the coin here. setarray .Price[0],20,40,300; // Price for each custom is set to 20 coins npcshopitem "custom_seller2",0,0; // Don't touch any coding beyond here for(set .i,0; .customs[.i]; set .i,.i+1) npcshopadditem "custom_seller2",.customs[.i],.Price[.i]; end; }  
    Fill out the arrays .customs, and .price...
     
    Edit-- Didn't see Emistry's post... Haha this is an old script back from the eAthena days anyways . It's a very good one though I come back to this as a base for all of my shops.
  7. Skorm's post in auto prize box was marked as the answer   
    Alright I forgot one thing in the function so the rate should be fixed now. To add items exclusive to the party leader use the first callfunc.
    prontera,150,150,5 script Tier 1 Award 100,{ if(getcharid(0)!=getpartyleader(getcharid(1),2)) end; callfunc("package_func",3,7899,1,50); getpartymember(getcharid(1),2); set .mem, $@partymembercount; copyarray .mem_aid[0], $@partymemberaid[0], 128; while(.@i<.mem) { set(.@i,.@i+1); if(isloggedin(.mem_aid[.@i-1])){ attachrid(.mem_aid[.@i-1]); callfunc("package_func",3,12246,1,10); } } set @id,getcharid(1); warpparty "prontera",165,24,@id; disablenpc "Tier 1 Award"; end; OnInit: disablenpc "Tier 1 Award"; } /// callfunc("package_func",<length>,<itemid>,<amount>,<chance>{,<itemid>,<amount>,<chance>{,<itemid>,<amount>,<chance>{,...}}}) function script package_func { set .@len, getarg(0)+1; set(.@i,1); while(.@i<.@len) { set(.@i,.@i+3); if(rand(101)<=getarg(.@i-1)) { set(.@a,.@a+1); set(@package_item[.@a-1],getarg(.@i-3)); set(@package_amount[.@a-1],getarg(.@i-2)); getitem(@package_item[.@a-1],@package_amount[.@a-1]); } } return .@a; } prontera,151,151,5 script Tier 1 106,{ if (getcharid(1) < 1) { mes "You're not in a party."; } else if (getpartyleader(getcharid(1),2) != getcharid(0)) { mes "You are not the party leader."; } else { getpartymember(getcharid(1)); set .mem, $@partymembercount; if (.mem < 2) { mes "You need at least 2 party members."; } else { mes "[Summon Man]"; mes "Hi There,"; mes "Welcome to Riot's Tier 1"; next; mes "[Summon Man]"; mes "This is a custom party quest of XXXX RO that you need party members to get through on this quest..."; next; mes "[Summon Man]"; mes "This is not a simple MVP Room remember all MVP here is"; mes "a Edited Stats by your Admin which 1 or 2 people"; mes "cannot defeat the MVP's Hope you enjoy and good-luck..."; next; mes "[Summon Man]"; mes "Would you like to summon the first Boss?"; menu "Yes",-,"No",L_ayaw; next; mes "[Tier 1]"; mes "before you summon the boss please bring me the following"; next; mes "[Summon Man]"; mes "10x Platinum Bullion"; menu "Yes",-,"No",L_ayaw; next; mes "[Tier 1]"; mes "I'll be waiting for you chosen one!"; if(countitem(7230) < 10) goto koolang; if(countitem(7230) >= 10) goto k1; close; L_ayaw: mes "[Tier 1]"; mes "Just speak to me if you have the Requirements"; close; koolang: next; mes "[Tier 1]"; mes "As I said one missing material and all the others go to waste"; close; k1: next; mes "[Tier 1]"; mes "Very well done my friend you have finished the Tier 1 Quest"; mes "Get ready"; delitem 7230,10; next; monster "prontera",0,0,"Tier 1",1399,1,"Tier 1::OnDarkDead"; mes "[Tier 1]"; mes "Now go and kill the Great Baphomet"; close; OnDarkDead: announce "Party "+getpartyname(getcharid(1))+" has Finish the Tier 1",bc_all,0xFFFF00; enablenpc "Tier 1 Award"; end; L_Dead: announce "Summon Man: ",3; set $OnDarkDead,0; end; } } close; }
  8. Skorm's post in Get Map Player List was marked as the answer   
    prontera,150,150,5 script Give Item 100,{ set(.player,getcharid(3)); deletearray(.players[0],128); addrid(1); set(.players[getarraysize(.players)],getcharid(3)); detachrid; attachrid(.player); getitem(512,1,set(.@a,.players[rand(getarraysize(.players))])); npctalk rid2name(.@a)+" got a Apple!"; end; }  
    This is untested by me O_O and might not work because it will all happen at once.
     
    Tested working perfectly.
  9. Skorm's post in Requesting this Kind of GM Utility Script was marked as the answer   
    prontera,150,150,0 script Storage 100,{ set .@npc$, "Storage"; if ( !getgmlevel() ) end; mes .@npc$; mes "Input the name of the character"; next; input .@name$; query_sql("SELECT DISTINCT `account_id`,`char_id`,`online` FROM `char` WHERE `name` = '" +escape_sql(.@name$)+ "'",.@rid,.@cid,.@a); if ( .@rid && !.@a ) { mes .@npc$; mes "The character is currently offline."; mes "Re-routing storage..."; query_sql "INSERT INTO `storage` (`nameid`,`amount`,`equip`,`identify`,`refine`,`attribute`,`card0`,`card1`,`card2`,`card3`,`expire_time`) "+ "SELECT `nameid`,`amount`,`equip`,`identify`,`refine`,`attribute`,`card0`,`card1`,`card2`,`card3`,`expire_time` "+ "FROM `inventory` "+ "WHERE `char_id` = "+.@cid; query_sql "UPDATE `storage` "+ "SET `account_id` = "+.@rid+" "+ "WHERE `account_id` = 0"; query_sql "UPDATE `char` "+ "SET `weapon` = DEFAULT, "+ "`shield` = DEFAULT, "+ "`head_top` = DEFAULT, "+ "`head_mid` = DEFAULT, "+ "`head_bottom` = DEFAULT, "+ "`robe` = DEFAULT "+ "WHERE `char_id` = "+.@cid; query_sql "DELETE FROM `inventory` "+ "WHERE `char_id` = "+.@cid; mes "Items Stored!"; close; } else if( !.@rid ) { mes .@npc$; mes "That character doesn't seem to exist!"; close; } charcommand "#storeall " + .@name$; mes .@npc$; mes "Done!"; close; }  
    Alright I'm not sure what tables eAthena has and what they don't so remove the error tables that show up.
     
    From this...
    query_sql "INSERT INTO `storage` (`nameid`,`amount`,`equip`,`identify`,`refine`,`attribute`,`card0`,`card1`,`card2`,`card3`,`expire_time`) "+ "SELECT `nameid`,`amount`,`equip`,`identify`,`refine`,`attribute`,`card0`,`card1`,`card2`,`card3`,`expire_time` "+
  10. Skorm's post in Restart every X minutes the script was marked as the answer   
    Put
    minuteX: Where x is the minute you want the script to start on every hour.
     
    Or
     
    OnInit: OnTimerX: initnpctimer;  
    Where X is the amount of milliseconds you want to wait before re-running the script.
     
    Oninit: <script> Sleep X; goto Oninit;  
    Where X is the amount of time you want to wait between activations in milliseconds.
     
    You can do more things if a player is attached.
  11. Skorm's post in Who can add whisper to this 2 npc? was marked as the answer   
    I'm not really sure what you mean by pub, but for different maps just full a string with all the maps that you want and compare it with the users current location.
     
    Edit: So I thought about it and if by pub do you mean in a chat room? There really isn't a foolproof way I know of to keep a constant connection with a waiting room while returning the invoked characters rid... because and again I think this was a really dumb move... The rids aren't passed when calling a waiting room event. Instead they are obtained when you warp the player out of the waiting room... I could throw some tricks in the air like I've done before where I attached an OnTouch event to a waiting room npc and then waited for the player to enter a chatting state and cross check it with the status of the existing NPCs waiting room. But again that can be fooled by creating your own chat room in close proximity to the NPC and having someone else already in the NPCs chat room. Really I think we need more specific chat room related commands.
     
    - script SB -1,{ L_whisper: mes "[Soul Buffer]"; mes " Hello "+strcharinfo(0)+", I am the Soul Buffer npc, i can soul link or buff you at the cost of some zeny. "; next; mes "[Soul Buffer]"; mes " What can i do for you?"; next; set .@i,select( "Buff Me = $200,000","Soul Link Me = $200,000","I Need Both = $400,000" ); set .@cost,( ( .@i == 3 )? 400000:200000 ); if( Zeny < .@cost ){ mes "You dont have enough "+.@cost+" zeny."; }else{ set Zeny,Zeny - .@cost; if( .@i & 1 ){ percentheal 100,100; skilleffect 34,0; sc_start SC_BLESSING,360000,10; skilleffect 29,0; sc_start SC_INCREASEAGI,360000,10; } if( .@i & 2 ){ switch ( basejob ) { case Job_Alchemist: set .@spirit, 445; break; case Job_Monk: set .@spirit, 447; break; case Job_Star_Gladiator: set .@spirit, 448; break; case Job_Sage: set .@spirit, 449; break; case Job_Crusader: set .@spirit, 450; break; case Job_SuperNovice: set .@spirit, 451; break; case Job_Knight: set .@spirit, 452; break; case Job_Wizard: set .@spirit, 453; break; case Job_Priest: set .@spirit, 454; break; case Job_Bard: case Job_Dancer: set .@spirit, 455; break; case Job_Rogue: set .@spirit, 456; break; case Job_Assassin: set .@spirit, 457; break; case Job_Blacksmith: set .@spirit, 458; break; case Job_Hunter: set .@spirit, 460; break; case Job_Soul_Linker: set .@spirit, 461; break; default: if ( upper == 1 && baselevel < 70 ) set .@spirit, 494; } if ( .@spirit ) { sc_start4 sc_spirit, 360000, 5, .@spirit,0,0; skilleffect .@spirit, 5; } } mes "Done, Come back to me if you need my services again."; } close; OnWhisperGlobal: if( strnpcinfo(2) != "" || !compare(.maps$,strcharinfo(3)) && !checkchatting()) end; goto L_whisper; OnInit: set .maps$, "prontera|pay_fild01|geffen|izlude"; } prontera,180,191,2 duplicate(SB) Soul Buffer#1 936 morocc,167,53,3 duplicate(SB) Soul Buffer#2 936 gonryun,148,174,6 duplicate(SB) Soul Buffer#3 936 lighthalzen,177,114,5 duplicate(SB) Soul Buffer#4 936 payon,164,213,2 duplicate(SB) Soul Buffer#5 936
  12. Skorm's post in Attach timer to player was marked as the answer   
    prontera.gat,151,184,5 script Awesome Guy 100,{
    if(#ticker<gettimetick(2)) {
    mes "I think you're really awesome.";
    next;
    mes "Now you have to wait a week before you can hear that again.";
    set #ticker, gettimetick(2)+60*60*24*7;
    } else {
    mes "Come back next week for your complement.";
    }
    close;
    }

  13. Skorm's post in Any npc like this? was marked as the answer   
    /* Run this query before installing this script... CREATE TABLE IF NOT EXISTS `news` ( `id` bigint(20) unsigned NOT NULL auto_increment, `post_name` varchar(30) NOT NULL default '', `post_id` int(11) unsigned NOT NULL default '0', `title` varchar(45) NOT NULL default '', `message` varchar(255) NOT NULL default '', `time` date NOT NULL default '0000-00-00', `status` tinyint(2) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM; */ //Version 1 prontera.gat,151,184,5 script Server News 857,{ query_sql("SELECT * FROM `news` ORDER BY `id` DESC",.@id,.@post_name$,.@post_id,.@title$,.@message$,.@time$,.@status); set .@len, getarraysize(.@post_id); copyarray .@og_stat[0],.@status,128; set @menu, -1; if(getgmlevel()>10) { mes .npc$; mes "Would you like to view the normal player menu?"; next; if(select("No:Yes")&2) goto L_Menu; L_GM_Menu: mes .npc$; mes "Hello, "+strcharinfo(0)+", what would you like to do?"; next; switch(select("(^11772dAdd^000000)"+((.@len)?":(^FF0000Remove^000000)^0000FFFeature^000000):[^8700c9Submit^000000]":""))) { case 1: mes .npc$; mes "#Title# (45 Character Limit)"; input(.@title$[.@len]); mes "#Message# ("+.in_len+" Character Limit)"; input(.@message$[.@len]); next; while(getstrlen(.@message$[.@len])<.in_len) { set(.@length, .in_len-getstrlen(.@message$[.@len])); mes .npc$; mes "Would you like to add more to the message?"; mes "^656565("+.@length+" Characters Left)^000000"; next; if(select("Yes:No")&2) break; input(.@tmp$); set .@message$[.@len],.@message$[.@len]+.@tmp$; } set .@post_name$[.@len], strcharinfo(0); set .@post_id[.@len], getcharid(0); if(.rathena) set .@time$[.@len], gettimestr("%Y-%m-%d",21); else { query_sql("SELECT CURDATE()",.@tym$); set .@time$[.@len],.@tym$; } set .@status[.@len], 2; set .@og_stat[.@len], 2; set .@len, getarraysize(.@post_id); set .@id[.@len-1], .@len; mes .npc$; mes "Added!"; next; goto L_GM_Menu; case 2: mes .npc$; mes "Select a notice to remove or restore it."; next; Rm_Menu: set .@menu$, ""; set .@a, -1; while(set(.@a,.@a+1)<.@len) if(.@status[.@a]==1) set .@menu$,.@menu$+ .@post_name$[.@a]+ " [^0000FF"+.@title$[.@a]+ "^000000] ~ ("+.@time$[.@a]+"):"; else if (!.@status[.@a]) set .@menu$,.@menu$+ "^C0C0C0//"+.@post_name$[.@a]+ " ["+.@title$[.@a]+ "] ~ ("+.@time$[.@a]+")^000000:"; else if (.@status[.@a]==2) set .@menu$,.@menu$+ "^11772d+"+.@post_name$[.@a]+ " ["+.@title$[.@a]+ "] ~ ("+.@time$[.@a]+")^000000:"; else if (.@status[.@a]==-1) set .@menu$,.@menu$+ "^FF0000-"+.@post_name$[.@a]+ " ["+.@title$[.@a]+ "] ~ ("+.@time$[.@a]+")^000000:"; set .@menu$,.@menu$+"[^8700c9Back^000000]"; select(.@menu$); if(@menu-1>=.@len) goto L_GM_Menu; set .@status[@menu-1], ((.@status[@menu-1]==-1)? .@og_stat[@menu-1]:-1); goto Rm_Menu; case 3: mes .npc$; mes "Select a notice to enable or disable it."; next; Ft_Menu: set .@menu$, ""; set .@a, -1; while(set(.@a,.@a+1)<.@len) if(.@status[.@a]==1) set .@menu$,.@menu$+ .@post_name$[.@a]+ " [^0000FF"+.@title$[.@a]+ "^000000] ~ ("+.@time$[.@a]+"):"; else if (!.@status[.@a]) set .@menu$,.@menu$+ "^C0C0C0//"+.@post_name$[.@a]+ " ["+.@title$[.@a]+ "] ~ ("+.@time$[.@a]+")^000000:"; else if (.@status[.@a]==2) set .@menu$,.@menu$+ "^11772d+"+.@post_name$[.@a]+ " ["+.@title$[.@a]+ "] ~ ("+.@time$[.@a]+")^000000:"; else if (.@status[.@a]==-1) set .@menu$,.@menu$+ "^FF0000-"+.@post_name$[.@a]+ " ["+.@title$[.@a]+ "] ~ ("+.@time$[.@a]+")^000000:"; set .@menu$,.@menu$+"[^8700c9Back^000000]"; select(.@menu$); if(@menu>.@len) goto L_GM_Menu; set .@status[@menu-1], ((.@status[@menu-1])? 0:((.@og_stat[@menu-1])?.@og_stat[@menu-1]:1)); goto Ft_Menu; case 4: set .@a, -1; set .@b, 0; while(set(.@a,.@a+1)<.@len) { if(.@og_stat[.@a]==2&&.@status[.@a]==-1) set .@b, .@b+1; if(.@og_stat[.@a]==2&&.@status[.@a]!=-1) query_sql("INSERT INTO `news` (`post_name`,`post_id`,`title`,`message`,`time`,`status`) "+ "VALUES ('"+.@post_name$[.@a]+ "',"+.@post_id[.@a]+ ",'"+escape_sql(.@title$[.@a])+ "','"+escape_sql(.@message$[.@a])+"',"+ "CURDATE(),"+((.@status[.@a]>=1)?1:0)+")"); if(.@status[.@a]!=.@og_stat[.@a]&&.@status[.@a]!=-1) query_sql("UPDATE `news`"+ "SET `status`="+((.@status[.@a]>=1)?1:0)+" "+ "WHERE `id`="+(.@id[.@a]+.@+";"); if(.@status[.@a]<0&&.@og_stat[.@a]!=2) query_sql("DELETE FROM `news`"+ "WHERE `id`="+(.@id[.@a]+.@+";"); } mes .npc$; mes "Server News Updated!"; close; } } L_Menu: set .@a, -1; while(set(.@a,.@a+1)<.@len) if(.@status[.@a]) { set @menu, .@a; break; } L_PC_Menu: set .@a, -1; set .@menu$, ""; set .@f, 0; while(set(.@a,.@a+1)<.@len) { if(.@status[.@a]) { set .@menu$,.@menu$+ .@post_name$[.@a]+ " [^0000FF"+.@title$[.@a]+ "^000000] ~ ("+.@time$[.@a]+"):"; setarray .@b[.@a], .@f; } else set(.@f,.@f+1); } if(!.@len||.@menu$=="") { mes .npc$; mes "I'm sorry no news has been posted."; close; } mes "[^0000FF"+.@title$[@menu]+"^000000]"; if(compare(.@message$[@menu],.line$)) { if(.rathena) explode(@explode$,.@message$[@menu],.line$); else callfunc("str_explode","@explode$[0]",.@message$[@menu],"/"); set .@a, -1; set .@str_len, getarraysize(@explode$); while(set(.@a,.@a+1)<.@str_len) { if(.case&&!.rathena) { callfunc "str_toarray", @explode$[.@a], "@tmp$[0]"; set @tmp$[0],callfunc("str_changecase", @tmp$[0], 1); set @explode$[.@a],""; set .@i,0; while(getstrlen(@explode$[.@a])<getarraysize(@tmp$)) { set @explode$[.@a],@explode$[.@a]+@tmp$[.@i]; set .@i,.@i+1; } } mes @explode$[.@a]; } } else { mes .@message$[@menu]; } mes "By: "+.@post_name$[@menu]+"."; mes "^656565(@ "+.@time$[@menu]+")^000000"; next; set .@menu$,.@menu$+"Cancel"; select(.@menu$); if(@menu>(.@len-.@f)) close; set @menu, ((@menu-1)+.@b[(@menu-1)]); goto L_PC_Menu; end; OnInit: set .npc$, "[^0000FFServer News^000000]"; waitingroom "Server News!",0; set .rathena, 1; // If you're running rAthena or not. 0=off/1=on set .case, 1; // For non-rAthena only restores upper-case strings. set .in_len, 210; // Max input length. set .line$, "/"; // Line break used to seperate lines. /* Changing the linebreak for non-rAthena clients doesn't work You have to find callfunc("str_explode","@explode$[0]",.@message$[@menu],"/"); and change "/" to what ever you want. (Example "|").*/ } function script str_explode { if ( getarg(2,"") == "" ) return callfunc("str_toarray", getarg(1), getarg(0) ); sleep2 1; setarray .@char$, getarg(2), " ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "e", "i", "a", "s", "r", "n", "t", "o", "u", "l", "c", "p", "m", "d", "v", "h", "g", "f", "b", "y", "q", "k", "z", "x", "j", "w", "_", "-", "|", "/", ".", "'", "[", "]", "(", ")", "=", "*", "&", "#", "@", "!", "+", "`", "~", "%", "<", ">", "?", ",", "^", ":"; set .@charsize, getarraysize(.@char$); set .@tmp$, "|~key~|"; set .@str$, .@tmp$ + getarg(1) ; set .@len, getstrlen(getarg(1)); set .@parse_len, getstrlen(getarg(2)); while( .@len > .@s ) { set .@i, 0 ; while( .@i < .@charsize ) { if ( ! ( set(.@l,.@l+1) % 600) ) sleep2 1; if ( compare( .@str$ , .@tmp$ + .@char$[.@i] ) ) { set .@tmp$, .@tmp$ + .@char$[.@i]; if ( .@i ) set .@arr$[.@p], .@arr$[.@p] + .@char$[.@i]; else { set .@p, .@p + 1; set .@s, .@s + .@parse_len-1 ; } break; } set .@i, .@i+1 ; } if ( .@i == .@charsize ) return 0; else set .@s, .@s+1 ; } deletearray getd(getarg(0)); copyarray getd(getarg(0)), .@arr$, .@p+1; return .@p+1; } function script str_changecase { sleep2 1; if ( getarg(1) ) { setarray .@char$[ 0 ], " ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "E", "I", "A", "S", "R", "N", "T", "O", "U", "L", "C", "P", "M", "D", "V", "H", "G", "F", "B", "Y", "Q", "K", "Z", "X", "J", "W", "_", "-", "(", ")", ";", ",", ":", ".", "*", "!", "?", "'"; } else { setarray .@char$[ 0 ], " ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "e", "i", "a", "s", "r", "n", "t", "o", "u", "l", "c", "p", "m", "d", "v", "h", "g", "f", "b", "y", "q", "k", "z", "x", "j", "w", "_", "-", "(", ")", ";", ",", ":", ".", "*", "!", "?", "'"; } set .@charsize, getarraysize(.@char$); set .@str$, "|~key~|" + getarg(0) ; set .@len, getstrlen(getarg(0)); while( .@len>.@s ) { set .@i,0; while( .@i<.@charsize ) { if ( ! ( set(.@l,.@l+1) % 650) ) sleep2 1; if ( compare( .@str$ , "|~key~|" + .@tmp$ + .@char$[.@i] ) ) { set .@tmp$, .@tmp$ + .@char$[.@i]; break; } set .@i, .@i+1; } if ( .@i == .@charsize ) return ""; else set .@s, .@s+1; } return .@tmp$; } function script str_toarray { sleep2 1; if ( getstrlen( getarg(0) ) > 128 ) return 0; setarray .@char$[ 0 ], " ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "e", "i", "a", "s", "r", "n", "t", "o", "u", "l", "c", "p", "m", "d", "v", "h", "g", "f", "b", "y", "q", "k", "z", "x", "j", "w", "_", "-", "(", ")", ";", ",", ":", ".", "*", "!", "?", "'"; set .@charsize, getarraysize(.@char$); set .@tmp$, "|~key~|"; set .@str$, .@tmp$ + getarg(0) ; set .@len, getstrlen(getarg(0)); while( .@len>.@s ) { set .@i,0; while( .@i<.@charsize ) { if ( ! ( set(.@l,.@l+1) % 650) ) sleep2 1; if ( compare( .@str$ , .@tmp$ + .@char$[.@i] ) ) { set .@tmp$, .@tmp$ + .@char$[.@i]; set .@arr$[.@s], .@char$[.@i]; break; } set .@i, .@i+1; } if ( .@i == .@charsize ) return 0; else set .@s, .@s+1; } deletearray getd(getarg(1)); copyarray getd(getarg(1)), .@arr$, .@len; return .@len; }
  14. Skorm's post in activate pvp when X players are in a map. was marked as the answer   
    - script pvpon -1,{ OnPCLoadMapEvent: set .@usr_map$, strcharinfo(3); getpartymember $@TeamID1,1; getpartymember $@TeamID1,2; set .team1, $@partymembercount; copyarray .party_name_desu[0], $@partymemberaid[0],128; while(set(.@f,.@f+1)<=.team1) { if(getmapxy(.@map$,.@x,.@y,0,rid2name(.party_name_desu[.@f-1]))!=0) set .team1,.team1-1; if(.@map$==.@usr_map$) set(.@i,.@i+1); } getpartymember $@TeamID2,1; getpartymember $@TeamID2,2; set .team2, $@partymembercount; copyarray .party_name_desu2[0], $@partymemberaid[0],128; while(set(.@h,.@h+1)<=.team2) { if(getmapxy(.@map$,.@x,.@y,0,rid2name(.party_name_desu2[.@h-1]))!=0) set .team2,.team2-1; if(.@map$==.@usr_map$) { set(.@i,.@i+1); } } if(.@i >= 4 && .team1 >= 2 && .team2 >= 2) pvpon "guild_vs2"; end; OnPCDieEvent: if(strcharinfo(3)=="guild_vs2"&&getmapflag("guild_vs2",mf_pvp)) if(getcharid(1)==$@TeamID1) if(!(set(.team1,.team1-1))) { dispbottom "Party 2 Wins"; pvpoff "guild_vs2"; while(set(.@h,.@h+1)<=getarraysize(.party_name_desu2)) getitem 501,1,.party_name_desu2[.@h-1]; deletearray .party_name_desu[0],128; deletearray .party_name_desu2[0],128; } else if(getcharid(1)==$@TeamID2) if(!(set(.team2,.team2-1))) { dispbottom "Party 1 Wins"; pvpoff "guild_vs2"; while(set(.@h,.@h+1)<=getarraysize(.party_name_desu)) getitem 501,1,.party_name_desu[.@h-1]; deletearray .party_name_desu[0],128; deletearray .party_name_desu2[0],128; } } guild_vs2 mapflag loadevent  
    Sorry forgot about ghost party members.
  15. Skorm's post in Respawn map after death was marked as the answer   
    - script blah -1,{ OnPCDieEvent: sleep2 1000; while(.maps$[.@i++]!="") if(.maps$[.@i]==strcharinfo(3)) { recovery 0; warp .spaw$[.@i],.map_x[.@i],.map_y[.@i]; sleep2 3000; atcommand "@pvpoff"; } end; OnPCLoginEvent: warp "SavePoint",0,0; end; OnInit: setmapflag "prontera",mf_nosave; setarray .maps$[1], "prontera", "geffen", "izlude", "prt_fild01"; setarray .spaw$[1], "geffen", "prontera", "izlude", "prt_fild02"; setarray .map_x[1], 10, 15, 88, 13; setarray .map_y[1], 20, 16, 55, 12; } Alright last attempt lol. Otherwise you might have to search for the event where pvp is activated.
  16. Skorm's post in Ned Help! was marked as the answer   
    Above 
    prontera,150,182,5 script Ruzkie 106,{
  17. Skorm's post in Help How to .. was marked as the answer   
    - script killmark -1,{ OnPcKillEvent: set .@a$, strcharinfo(3); set .@b , getmapflag(.@a$,mf_pvp)+ getmapflag(.@a$,mf_gvg); if(.@ getitem 7420,1; }  
    If you wanted the script to be a little more dynamic and work on all pvp/gvg maps you could do that... You might also have to add same other map flags like mf_gvg_castle but I'm not sure how often they get used. You can find a whole list in your server db/const.txt.
  18. Skorm's post in Enchanter that can enchant 1st to 4th slot was marked as the answer   
    prontera,194,188,4 script Enchant Expert 712,{ mes .npc$; mes "Hello there!"; mes "I can enchant your items,"; mes "for a small fee of "+.pric+"z."; emotion e_no1,0; next; if(select("Yes:No")&2) { mes .npc$; mes "Alright, thanks anyways!"; close; } if(Zeny<.pric) { mes .npc$; mes "I'm sorry you don't have enough Zeny, please come back later."; close; } mes .npc$; mes "Which item would you like to enchant?"; next; while(set(.@a,.@a+1)<=.e_len) { if(getequipid(.@a)>-1) set .@menu$, .@menu$+.eqp$[.@a-1]+"- [^0000FF"+getitemname(getequipid(.@a))+"^000000]:"; else set .@menu$, .@menu$+"^adb4be"+.eqp$[.@a-1]+"- [Empty]^000000:"; } select(.@menu$); set .@eq_loc, @menu; set .@eq_itm, getequipid(.@eq_loc); if(.@eq_itm<0) { mes .npc$; mes "Hmm, I don't think you have anything equipped there."; close; } set .@menu$, ""; set .@a, .en_orb[0]; while((set(.@a,.@a+1)-1)<=.en_orb[1]) if(getiteminfo(.@a-1,2)>-1) if(set(.@c,countitem(.@a-1))) { set .@menu$, .@menu$+getitemname(.@a-1)+" x"+.@c+":"; set .@b,.@b+1; set .@item[.@b], .@a-1; } if(.@menu$=="") { mes .npc$; mes "Hmm, you don't seem to have any enchantment orbs."; close; } mes .npc$; mes "Please, select an enchantment from the menu."; next; select(.@menu$); set .@itm, .@item[@menu]; set .@menu$, ""; set .@a, 0; while((set(.@a,.@a+1)-1)<4) { setd(".@crd"+.@a, getequipcardid(.@eq_loc,.@a-1)); if(getequipcardid(.@eq_loc,.@a-1)) set .@menu$, .@menu$+.@a+.crd_c$[.@a-1]+" Slot- [^a92435"+getitemname(getequipcardid(.@eq_loc,.@a-1))+"^000000]:"; else set .@menu$, .@menu$+.@a+.crd_c$[.@a-1]+" Slot- [^30ad25Empty^000000]:"; } mes .npc$; mes "Select a slot."; next; select(.@menu$); set .@eqrf, getequiprefinerycnt(.@eq_loc); if(getequipcardid(.@eq_loc,@menu-1)) { mes .npc$; mes "Would you like me to remove this card?"; next; if(select("Yes:No")&2) { mes .npc$; mes "Alright, thanks anyways!"; close; } getitem getequipcardid(.@eq_loc,@menu-1),1; delitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4; setd(".@crd"+@menu, 0); getitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4; } if(rand(100)>.perc) { mes .npc$; mes "I'm sorry but I've failed you!"; misceffect 155; emotion e_sob,0; set Zeny,Zeny-.pric; close; } set Zeny,Zeny-.pric; delitem .@itm,1; delitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4; setd(".@crd"+@menu, .@itm); getitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@crd1, .@crd2, .@crd3, .@crd4; misceffect .efet; emotion e_no1,0; mes .npc$; mes "All done!"; equip .@eq_itm; close; //NPC Constants OnInit: //=-=-=-=-=-=-=Configuration=-=-=-=-=-=-= set .npc$ , "[^0000FFEnchant Expert^000000]"; // NPC Name set .pric , 1000000; // Price set .efet , 154; // Effect Number set .perc , rand(50,80); // Percent setarray .crd_c$, "st", "nd", "rd", "th"; // Count setarray .en_orb, 4700, 4862; // Range of IDs selected for enchanting. setarray .eqp$ , "Upper Headgear", "Armor", "Left Hand", "Right Hand", "Garment", "Shoes", "Accessory1", "Accessory2", "Mid Headgear", "Low Headgear"; set .e_len , getarraysize(.eqp$); //=-=-=-=-=-=-=-=-Skorm-=-=-=-=-=-=-=-=-= }
  19. Skorm's post in Help OnPcDieEvent was marked as the answer   
    prontera,99,120,4 script death 78,{ end; OnPCDieEvent: if(strcharinfo(3)=="payon"){ warp "SavePoint",0,0; } warp "prontera",0,0; sleep2 1000; announce "Hey "+strcharinfo(0)+", It seems you have died! Don't worry, you will be resurected in 3 Seconds!",bc_blue|bc_self; announce "3",bc_blue|bc_self; sleep2 1000; announce "2",bc_blue|bc_self; sleep2 1000; announce "1",bc_blue|bc_self; sleep2 1000; announce "Respawning..",bc_blue|bc_self; atcommand "@alive "+strcharinfo(0); sleep2 1000; atcommand "@load "+strcharinfo(0); }
  20. Skorm's post in Is this possible to make? Chat/waitroom with warp was marked as the answer   
    prontera,100,100,5 script NPCNPC 100,{ end; OnWarp: if(countitem(.itemid)<.itmamt) { atcommand "@refresh"; mes "I'm sorry but you don't have enough "+getitemname(.itemid)+" to enter this chat."; close; } delitem .itemid,.itmamt; if(getwaitingroomstate(32)) warpwaitingpc "prontera",100,100,getwaitingroomstate(0); end; OnInit: set .itemid, 7539; set .itmamt, 1 ; set .amtppl, 10 ; waitingroom "ChatWarp",(.amtppl+1),"NPCNPC:OnWarp",1; }  
    Untested because my Harddrives dying and half my files are fragmented but yeah hope it work. Because I think the rid might not be passed through a waiting room event...
     

     
    You can also try this script, but it needs to be located away from other npcs and might also get activated by player based chat rooms. Still untested.
     
    prontera,100,100,5 script NPCNPC 100,24,24,{ end; OnTouch: while(.@map$==""||sqrt(pow([email protected],2)+pow([email protected],2))<24) { getmapxy(.@map$,.@x,.@y,0); if(checkchatting(strcharinfo(0))) { set .@tmp, countitem(.itemid); if(.@tmp<.itmamt) { atcommand "@refresh"; mes "I'm sorry but you don't have enough "+getitemname(.itemid)+" to enter this chat."; mes "You need "+(.itmamt-.@tmp)+" more."; close; } delitem .itemid,.itmamt; dispbottom "Item deleted: You can continue waiting for the event."; break; } } end; OnWarp: if(getwaitingroomstate(32)) warpwaitingpc "prontera",100,100,getwaitingroomstate(0); end; OnInit: set .itemid, 7539; set .itmamt, 1 ; set .amtppl, 10 ; getmapxy(.map$,.x,.y,1); waitingroom "ChatWarp",(.amtppl+1),"NPCNPC:OnWarp",1; }
  21. Skorm's post in How to disable this delay was marked as the answer   
    I imagine there are better ways of doing this but whatever works right.
    void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int hp, unsigned int sp) { unsigned int tick = gettick(); int warpgodelaycd = 5000; //This is the delay in milliseconds you can set what ever delay you want struct map_session_data *md = (struct map_session_data *)src; if (sp) clif_updatestatus(sd,SP_SP); if (hp) clif_updatestatus(sd,SP_HP); else return; if( !src || src == &sd->bl ) return; if(src->type == BL_PC) { sd->warpgodelay_tick = tick+warpgodelaycd; //This is the timer md->warpgodelay_tick = tick+warpgodelaycd; //This is the timer } if( pc_issit(sd) ) { pc_setstand(sd); skill_sit(sd,0); } if( sd->progressbar.npc_id ) clif_progressbar_abort(sd); if( sd->status.pet_id > 0 && sd->pd && battle_config.pet_damage_support ) pet_target_check(sd,src,1); if( sd->status.ele_id > 0 ) elemental_set_target(sd,src); sd->canlog_tick = gettick(); }
  22. Skorm's post in How to delete account using SQL if they are not active? was marked as the answer   
    Stydianx's post reminded me that you have to delete characters to... but there is also a bunch of other information to delete.
    CREATE TEMPORARY TABLE TmpTable AS (SELECT `account_id`,`char_id` FROM `char` WHERE `account_id` IN (SELECT `account_id` FROM `login` WHERE `lastlogin` < (CURRENT_TIMESTAMP - interval '5' month))); #Add tables to delete from here. DELETE FROM `guild` WHERE `char_id` IN (SELECT `char_id` FROM TmpTable); DELETE FROM `skill` WHERE `char_id` IN (SELECT `char_id` FROM TmpTable); DELETE FROM `quest` WHERE `char_id` IN (SELECT `char_id` FROM TmpTable); DELETE FROM `mercenary_owner` WHERE `char_id` IN (SELECT `char_id` FROM TmpTable); DELETE FROM `auction` WHERE `seller_id` IN (SELECT `char_id` FROM TmpTable); DELETE FROM `mercenary` WHERE `char_id` IN (SELECT `char_id` FROM TmpTable); DELETE FROM `memo` WHERE `char_id` IN (SELECT `char_id` FROM TmpTable); DELETE FROM `inventory` WHERE `char_id` IN (SELECT `char_id` FROM TmpTable); DELETE FROM `hotkey` WHERE `char_id` IN (SELECT `char_id` FROM TmpTable); DELETE FROM `cart_inventory` WHERE `char_id` IN (SELECT `char_id` FROM TmpTable); DELETE FROM `homunculus` WHERE `char_id` IN (SELECT `char_id` FROM TmpTable); DELETE FROM `friends` WHERE `char_id` IN (SELECT `char_id` FROM TmpTable); DELETE FROM `global_reg_value` WHERE `char_id` IN (SELECT `char_id` FROM TmpTable); DELETE FROM `elemental` WHERE `char_id` IN (SELECT `char_id` FROM TmpTable); DELETE FROM `pet` WHERE `account_id` IN (SELECT `account_id` FROM TmpTable); DELETE FROM `party` WHERE `leader_id` IN (SELECT `account_id` FROM TmpTable); DELETE FROM `guild_member` WHERE `account_id` IN (SELECT `account_id` FROM TmpTable); DELETE FROM `sc_data` WHERE `account_id` IN (SELECT `account_id` FROM TmpTable); DELETE FROM `storage` WHERE `account_id` IN (SELECT `account_id` FROM TmpTable); DELETE FROM `char` WHERE `account_id` IN (SELECT `account_id` FROM TmpTable); DELETE FROM `login` WHERE `account_id` IN (SELECT `account_id` FROM TmpTable); DELETE FROM `login` WHERE `lastlogin` < (CURRENT_TIMESTAMP - interval '5' month); DROP TABLE TmpTable; Will delete all accounts that haven't logged in for less than 5 months.
  23. Skorm's post in Leveling room was marked as the answer   
    I'll probably be updating it a little... but this is a Dynamic Leveling based system thingy... No need to hard code mob spawns...The script is a little heavy on the server side because -.- and this is the really lame part... Killedrid isn't set with monster spawned events... IKR WTF.
    Also if you run into one of the rooms and do @killmonster they won't spawn back untill you reloadscripts just saying right now don't do it... I had a whole system worked out for getting the correct information but yeah... I need a way to single out the event and get the mobid... That can't happen with OnNPCKillEvent. Anyways here it is... Only works with rAthena SQL Based servers that have there mod_dbs SQL side.
    prontera,160,158,2 script Training Room 100,{ select(.menu$); warp getd(".room"+(@menu-1)+"$[1]"),0,0; end; OnNPCKillEvent: //OnMobDeath: for(set .@p,0;getarraysize(getd(".room"+.@p+"$"));set(.@p,.@p+1)) if( playerattached() ) { if( getd(".room"+.@p+"$[1]") == strcharinfo(3) ) { monster strcharinfo(3),0,0,"--ja--",killedrid,1/*,"Training Room::OnMobDeath"*/; break; } } end; Oninit: //Configuration // # Room Name , Map , MobLvlRngLow , MobLvlRngHigh, #SpawnMobs, Mobs Limit(MAX 128), Optional Search String ; setarray .room0$, "Novice Room %s~%s (<mob>,<mob>...)" , "06guild_01", "0" , "10" , "20" , "128" , "`iName` LIKE '%Por%'" ; // Would make a novice poring room. setarray .room1$, "Beginner Room %s~%s (<mob>,<mob>...)" , "06guild_02", "11" , "20" , "5" , "128" , "" ; setarray .room2$, "Adept Room %s~%s (<mob>,<mob>...)" , "06guild_03", "21" , "30" , "5" , "128" , "" ; setarray .room3$, "Advanced Room %s~%s (<mob>,<mob>...)" , "06guild_04", "31" , "40" , "5" , "128" , "" ; setarray .room4$, "Experts Room %s~%s (<mob>,<mob>...)" , "06guild_05", "41" , "50" , "5" , "128" , "" ; setarray .room5$, "Veterans Room %s~%s (<mob>,<mob>...)" , "06guild_06", "51" , "60" , "6" , "128" , "" ; setarray .room6$, "MVP Room %s~%s (<mob>,<mob>...)" , "06guild_07", "61" , "70" , "7" , "128" , "" ; setarray .room7$, "Like a Boss Room %s~%s (<mob>,<mob>...)", "06guild_08", "71" , "80" , "8" , "128" , "" ; set .srch$, "<mob>"; //String searched and replaced with mob name in the Room Name Feild. set .mvps, 0; //Mvps Summoned or not? 0=Off 1=On //End for(set(.@a,0);getarraysize(getd(".room"+.@a+"$"));set(.@a,.@a+1)) { set .rmn$, ".room"+.@a+"$"; set .nam$, ".name"+.@a+"$"; set .mid$, ".id"+.@a; set .rrm$, getd(.rmn$+"[0]"); set .map$, getd(.rmn$+"[1]"); set .lrl$, getd(.rmn$+"[2]"); set .lrh$, getd(.rmn$+"[3]"); set .nsms, atoi(getd(.rmn$+"[4]")); set .mlim, atoi(getd(.rmn$+"[5]")); set .ops$, getd(.rmn$+"[6]"); set .length, countstr(getd(.rmn$+"[0]"), .srch$); set .lengt, countstr(getd(.rmn$+"[0]"), "%s"); if(.lengt>1) set .mes$[.@a], sprintf(.rrm$,.lrl$,.lrh$); set .len, query_sql("SELECT `ID`,`iName` FROM `mob_db` WHERE `LV` > "+.lrl$+" AND `LV` < "+.lrh$+" "+((.ops$!="")?"AND "+.ops$+" ":"")+((!.mvps)?"AND `MEXP` <= 0 ":"")+"ORDER BY RAND() LIMIT "+((.mlim>128)?128:.mlim )+";",.id,.name$); set .lens, getarraysize(.name$); copyarray getd(.nam$+"[0]"), .name$, .lens; copyarray getd(.mid$+"[0]"), .id, .lens; deletearray .name$; deletearray .id; while(.@i++<=.length ) if(.@i<=.lens) set .mes$[.@a], replacestr(.mes$[.@a], .srch$, getd(.nam$+"["+(.@i-1)+"]"), 1, 1); set .@i,0; for(set(.@h,0);.@h<.lens;set(.@h,.@h+1)) { monster .map$,0,0,"--ja--",getd(.mid$+"["+.@h+"]"),.nsms/*,"Training Room::OnMobDeath"*/; } } set .menu$, implode(.mes$,":"); }If you have any questions feel free to ask. BTW this will spawn any monster in your mob_db if they are the right level... so if you have errored mobs that you don't want to spawn I suggest you add a condition in the search for it... Other then that this thing saves loads of time.
  24. Skorm's post in any sign npc like this? was marked as the answer   
    prontera,136,182,7 script Kyojin RO Mall 837,{ end;
    OnInit:
    waitingroom "Kyojin RO Mall!",0;
    }
  25. Skorm's post in Dual Client kick at same map was marked as the answer   
    Old version

     
    Old Version 2
     
    Old Version 3
     
    Universal v4:
    - script dualclientkicker -1,{ OnPCLoadMapEvent: set .@charmap$, strcharinfo(3); if(!compare(.tmp$,.@charmap$)) end; //set .@len, query_sql("SELECT DISTINCT `account_id` FROM `char` WHERE `account_id` IN (SELECT `account_id` FROM `login` WHERE `last_ip` = (SELECT `last_ip` FROM `login` WHERE `account_id`="+getcharid(3)+")) AND `online` <> 0;",.@a); set .@len, query_sql("select account_id from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_ip = '"+ getcharip() +"'",.@a ); //Annieruru Addition. if(.@len-1) { for(set(.@d,0);.@d<.@len;set(.@d,.@d+1)) { getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d])); if(.@charmap$==.@map$&&rid2name(.@a[.@d])!=strcharinfo(0)) { dispbottom "Duel accounts not allowed in WOE."; warp "geffen",0,0; } } } end; OnInit: setarray .maps$ , "aldeg_cas01", "gefg_cas01", "payg_cas01", "prtg_cas01"; set .lens , getarraysize(.maps$) ; for(set(.a,0);.a<.lens;set(.a,.a+1)) { setmapflag .maps$[.a], mf_loadevent ; set .tmp$ ,.tmp$+.maps$[.a]+","; } }
×
×
  • Create New...