Jump to content

Skorm

Forum Moderator
  • Posts

    1282
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Skorm

  1. - script Players -1,{ OnMinute00: .u = getusers(1); .i = 0; .a = 0; addrid(0); if( checkvending() || checkidle() > 60 ) .i++; .a++; if( .u==.a ) announce "There are currently "+( .u=.a-.i )+" active player"+( .u==1?"":"s" )+" online!",bc_all; } Woops sorry, Dokiee, I read your request wrong. I think Emistry has the right idea.
  2. Skorm

    New freebie NPC

    I don't see why not... except for maybe if there are 2 prizes really close to each other... at different levels like a prize at level 1 and a different prize at level 2 if you killed a monster and went to level 3 you would only get the prize for level 1... I'm going to see if I can create a temporary loop to fix this.
  3. Skorm

    New freebie NPC

    Hi, yeah I could easily do that... really you don't have to change much at all. I hope you're using rAthena though because the newest version is much faster but only works with rAthena and maybe Hercules. //Automated Version 1 rAthena Only - script Freebie NPC -1,{ //Configurable Char Variables OnPCBaseLvUpEvent: @npc$ = "[^0000FF"+strnpcinfo(1)+"^000000]"; setarray @cmds$, "getitemname", "getcharid", "strcharinfo", "strnpcinfo" , "countitem", "blvl" , "jlvl" , "var" ; //End //Character Vars .@blvl = BaseLevel; .@getitm$ = ".itm"+#itmget+"$"; .@getitm_len = getarraysize(getd(.@getitm$)); .@rblvl = atoi(getd(.@getitm$+"[2]")); .@itmid = atoi(getd(.@getitm$)); .@itmam = atoi(getd(.@getitm$+"[1]")); @nxtrblvl = atoi(getd(".itm"+(#itmget+1)+"$[2]")); freeloop(1); //End //NPC Dialogue if(.@blvl>=.@rblvl) { for(.@s=0;.@s<(.@getitm_len-3);.@s++){ .@op$=callfunc("dispmes_func",getd(.@getitm$+"["+(.@s+3)+"]")); if(compare(.@op$,"next;")) { .@op$=""; next; } if(compare(.@op$,"menu;")) { if(select("Yes:No")&2) close; .@op$=""; } if(compare(.@op$,"close;")) { .@op$=""; close; } if(compare(.@op$,"item;")) { if(compare(.@op$,"item;(")) { .@s$=callfunc("find_value",.@op$); explode(.@op$, .@s$, ","); .@op_len=getarraysize(.@op$); while(.@t<.@op_len) { getitem(atoi(.@op$[.@t]),atoi(.@op$[.@t+1])); .@t=.@t+2; } #itmget++; .@op$=""; } else { .@op$=""; getitem .@itmid,.@itmam; #itmget++; } } if(compare(.@op$,"npc;")) { .@op$=@npc$; } if(.@op$!="") mes .@op$; } } end; //End OnInit: //Configure NPC Items & Dialogue HERE! // ItemID, Amount, Required-BaseLevel, setarray .itm0$, "501" , "10" , "2", "Item;(501,1,502,2,503,3)"; setarray .itm1$, "502", "20", "70", "Item;(504,1,505,2,506,3)", "Item;(507,1,508,2,509,3)"; setarray .itm2$, "1599", "1", "120", "Npc;", "You, sir, are a true god!", "Hh-h-here is your getitemname(1599).", "item;", "close;"; //End /*Explanation: The first three values in each row are the only constant numbers. First is the item_id then the amount you want to give then the level you give it at. Every line after that is lucid. You can type what the npc is going to say. You can also use optional commands that I will list below to display information. Add new conditions by following my example just remember to change .itm<#>$ to the next value. I hope everyone can understand this x.x Keep in mind this is just the first version. It's still a little slow. You can change upper-case to ignore for speedup. Commands Explained: Commands that takeup one line: "Npc;", -> This will display the npcs name. "Item;", -> Will give the player item and increase quest value. (Optional) "Item;(501,1,502,2,503,3)", -> Will give the player multiple items and increase quest value. "Menu;", -> This will display a Yes and No menu. "Close;", -> This will close the script. "Next;", -> This will refresh chat window and display Next button. Commands that can be used in chat: getitemname(<itemid>) -> Shows item name in chat. getcharid(<type>) -> Will return character id number. strcharinfo(<type>) -> displays information from charinfo. EX: strcharinfo(0) = Characters Name countitem(<itemid>) -> displays the count of the itemid. blvl() -> Displays baselevel. jlvl() -> Displays joblevel. Skorm */ } function script dispmes_func { .@message$ = getarg(0); explode(@explosion$, .@message$, " "); .@len = getarraysize(@explosion$); for(.@a=0;.@a<.@len;.@a++) { for(.@b=0;.@b<getarraysize(@cmds$);.@b++){ if (compare(@explosion$[.@a],@cmds$[.@b])){ .@s$ = callfunc("find_value",@explosion$[.@a]); .@output$ = callfunc("commands_func",.@b,.@s$); .@message$ = replacestr(.@message$, @cmds$[.@b]+"("+.@s$+")", .@output$); } } } return .@message$; } function script commands_func { switch(getarg(0)){ case 0: return getitemname(atoi(getarg(1))); case 1: return getcharid(atoi(getarg(1))); case 2: return strcharinfo(atoi(getarg(1))); case 3: return strnpcinfo(atoi(getarg(1))); case 4: return countitem(atoi(getarg(1))); case 5: return BaseLevel; case 6: return JobLevel; case 7: return getd(getarg(1)); } } function script find_value { .@l = strpos(getarg(0), "(", 0); .@r = strpos(getarg(0), ")", 0); return substr(getarg(0), (.@l+1), (.@r-1)); }
  4. - script rates -1,{ OnPCLoginEvent: OnPCJobLvUpEvent: OnPCBaseLvUpEvent: if( BaseLevel < 130 ) { sc_start SC_EXPBOOST,864000000,1000; sc_start SC_JEXPBOOST,864000000,1000; sc_start SC_ITEMBOOST,864000000,1000; } if( JobLevel >= 70 ) sc_end SC_JEXPBOOST; if( BaseLevel >= 130 ) { sc_end SC_EXPBOOST; sc_end SC_JEXPBOOST; sc_end SC_ITEMBOOST; } end; }
  5. Skorm

    VIP SYSTEM

    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`;
  6. Skorm

    VIP SYSTEM

    Edit-- Edit-- Small fix forgot a $ This isn't really my script so I mean I'll fix it, but original functions should be added by the creator. I did add a small menu to select which service you want to upgrade to.
  7. Like he said change BaseLevel >= 70 to JobLevel >= 70 I didn't realize you wanted it for joblevel when I read it first.
  8. Skorm

    VIP SYSTEM

    Oh ic looks like that error existed prior to my investments. Find: callfunc( "VIP_upgrade", 7, .item_premium ); Replace With: callfunc( "VIP_upgrade", 7, .item_premium, X ); Where "X" is the number of premium you want your player to upgrade to. 0 = Bronze 1 = Silver 2 = Gold Also you might want to change .item_premium to the item id you want the player to use. Like POD or something, because it doesn't look like that was ever set. Example: callfunc( "VIP_upgrade", 7, 501, 2 ); Is gold for the cost of one red potion.
  9. Skorm

    VIP SYSTEM

    Alright there were a bunch of gettimestr commands everywhere which is kinda redundant because MySql has it's own time string command lol. Anyway this seems to be working on my eAthena test server. Please make sure you add all the sql databases because it looks like you're still getting errors with that. Edit--
  10. Skorm

    VIP SYSTEM

    You have to run this code in your phpmyadmin... 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'; And the rest of them as well if you haven't already.
  11. Skorm

    VIP SYSTEM

    It looks like you're using eAthena... You can consider upgrading to rAthena or try this... I just did a quick skim and added some string functions created by KeyWorld. I haven't had time to test it. Will do when I get home. Edit--
  12. Skorm

    VIP SYSTEM

    You might be using a txt server???? Please post the error that shows up in the terminal when you click or load the npc thanks
  13. - script rates -1,{ OnPCLoginEvent: OnPCBaseLvUpEvent: if( BaseLevel < 130 ) { sc_start SC_EXPBOOST,864000000,1000; sc_start SC_JEXPBOOST,864000000,1000; sc_start SC_ITEMBOOST,864000000,1000; } If( BaseLevel >= 70 ) { sc_end SC_JEXPBOOST; if( BaseLevel >= 130 ) { sc_end SC_EXPBOOST; sc_end SC_ITEMBOOST; } } end; }
  14. I'll have to check this out when I get a chance.
  15. What? Why? getmonsterinfo(killedrid,22) Ugh nvm... MVP EXP is an rAthena thing... Geez it's hard too keep track of all the changes. - script Anti123 -1,{ OnNPCKillEvent: if ( !compare(.mvps$,"|"+killedrid+"|") ) end; set @bot_chk, @bot_chk+1; if (@bot_chk < 1) end; else set @bot_chk,0; set .@user$, strcharinfo(0); attachnpctimer; startnpctimer; atcommand "@mute 1 "+.@user$; set .@A, rand(1,10); set .@B, rand(1,10); mes "If A = "+.@A+" B = "+.@B; cutin "kafra_08",2; switch ( rand(4) ) { case 0: set .@Answer,.@A + .@B; mes "How many is A + B ?"; break; case 1: set .@Answer,.@A - .@B; mes "How many is A - B ?"; break; case 2: set .@Answer,.@A * .@B; mes "How many is A * B ?"; break; case 3: set .@Answer,.@A / .@B; mes "How many is A / B ?"; } input .@Input; if ( .@Input == .@Answer ) { mes "Good Job!"; cutin "",255; stopnpctimer; close2; detachrid; atcommand "@unmute "+.@user$; end; } mes "Wrong"; stopnpctimer; detachrid; atcommand "@kick "+.@user$; close; OnTimer60000: mes "Time Out!"; stopnpctimer; sleep 1000; atcommand "@kick "+.@user$; end; OnInit: set .mvps$, "|5001|5002|5003|5004|5005|"; }
  16. Half the time these things are just a big guessing game.
  17. Using the original script. - script Anti123 -1,{ OnNPCKillEvent: if ( !getmonsterinfo(killedrid,22) ) end; set @bot_chk, @bot_chk+1; if (@bot_chk < 1) end; else set @bot_chk,0; set .@user$, strcharinfo(0); attachnpctimer; startnpctimer; atcommand "@mute 1 "+.@user$; set .@A, rand(1,10); set .@B, rand(1,10); mes "If A = "+.@A+" B = "+.@B; cutin "kafra_08",2; switch ( rand(4) ) { case 0: set .@Answer,.@A + .@B; mes "How many is A + B ?"; break; case 1: set .@Answer,.@A - .@B; mes "How many is A - B ?"; break; case 2: set .@Answer,.@A * .@B; mes "How many is A * B ?"; break; case 3: set .@Answer,.@A / .@B; mes "How many is A / B ?"; } input .@Input; if ( .@Input == .@Answer ) { mes "Good Job!"; cutin "",255; stopnpctimer; close2; detachrid; atcommand "@unmute "+.@user$; end; } mes "Wrong"; stopnpctimer; detachrid; atcommand "@kick "+.@user$; close; OnTimer60000: mes "Time Out!"; stopnpctimer; sleep 1000; atcommand "@kick "+.@user$; }
  18. Like this? prontera,150,150,5 script Monster Spawner 100,{ monster "prontera",151,151,"Poringz0rd",2341,1,"Monster Spawner::OnDeath"; monster "prontera",151,150,"Drops",1113,1; monster "prontera",151,149,"Poporing",1031,1; sleep 1000; npctalk "I will now kill the Poringz0rd!"; sleep 1000; killmonster "prontera","Monster Spawner::OnDeath",1; end; OnDeath: npctalk "Fear not! The Poringz0rd has been slain!"; } This is the only way I know of currently... So you have to spawn the monster with a specific event label and target it through that method. Until the mobsearch and new getmapxy commands are implemented. Edit-- I thought of a few more that I used previously. Using bg_monster and .@gid with unitkill I'm not sure if it triggers the death event still though. prontera,150,150,5 script Monster Spawner 100,{ set .@gid, bg_monster(.@foo,"prontera",151,151,"Poringz0rd",1002,"Monster Spawner::OnDeath"); monster "prontera",151,150,"Drops",1113,1; monster "prontera",151,149,"Poporing",1031,1; sleep 1000; npctalk "I will now kill the Poringz0rd!"; sleep 1000; unitkill .@gid; end; OnDeath: npctalk "Fear not! The Poringz0rd has been slain!"; } Another way with bg_monster. prontera,150,150,5 script Monster Spawner 100,{ set .@gid, bg_monster(.@foo,"prontera",0,0,"bar",1002,"Monster Spawner::OnDeath"); mercenary_create 6017,999; .@gid++; killmonster "prontera","Monster Spawner::OnDeath"; sleep 1000; npctalk "I will now kill you helping hand!"; sleep 1000; unitkill .@gid; npctalk "The Mercenary has been slain!"; end; } In this example I summoned a fake monster with bg_monster off screen to get the gameid for our next summoned creature... This can be used to return the gameid of anything we cannot normally. If using in the right way even players.
  19. http://code.google.com/p/ea-addicts/downloads/detail?name=mvpspawner.txt&can=2&q=
  20. Hmm you could do this with an item... - script rates -1,{ OnPCLoginEvent: OnPCBaseLvUpEvent: sc_end SC_EXPBOOST; sc_end SC_JEXPBOOST; sc_end SC_ITEMBOOST; if(!itemget) { set itemget, 1; rentitem 731,60*60*24*10; } OnNPCTimerEvent: if( countitem(731) ) { switch( BaseLevel/((BaseLevel>=130)?65:90) ) { case 0: sc_start SC_EXPBOOST,86400000,1000; sc_start SC_JEXPBOOST,86400000,1000; sc_start SC_ITEMBOOST,86400000,1000; break; case 1: sc_start SC_EXPBOOST,86400000,900; sc_start SC_JEXPBOOST,86400000,900; sc_start SC_ITEMBOOST,86400000,900; break; case 2: sc_start SC_EXPBOOST,86400000,10; sc_start SC_JEXPBOOST,86400000,10; sc_start SC_ITEMBOOST,86400000,10; } end; } addtimer 86400000,"rates::OnNPCTimerEvent"; sc_start SC_EXPBOOST,86400000,1000; sc_start SC_JEXPBOOST,86400000,1000; sc_start SC_ITEMBOOST,86400000,1000; } Same concept as before so you'd need a base experience rate lower or equal to the lowest rate here.
  21. First I'd like to ask. Are you talking about a mvp room or random mvp spawns? If you're talking about for an mvp room please post the script you're using. Also I recommend you do this so we can forever avoid the problem that keeps happening here.
  22. I'd like to see this script come to fruition, but perhaps a rough collage of these scripts done by you would've been a better example.
  23. It does, I've used it before with multiple cases. I think Killmesoftly might've forgot to add the second parenthesis. In any case it's still better to use == even though it doesn't look as cool, because there is one less operation for the script to run. Apposed to the (!(var&2)).
  24. Before... Onstartevent: Add... OnClock<hour><minute>: set .SpecialPorings,<MobID>; set .NormalPorings,<MobID>; set .Map$,"prontera"; set .ItemID,<PrizeID>;
  25. Skorm

    party warp

    Semi-tested... I think this is what you're looking for... function script warp2partymember { if(!getcharid(3)) end; getpartymember(getcharid(1),2); copyarray .@paid[0], $@partymemberaid[0],128; getpartymember(getcharid(1),1); copyarray .@pcid[0], $@partymembercid[0],128; set .@len, $@partymembercount; set .@cid, getcharid(0); for(set(.@i,0);.@i<.@len;set(.@i,.@i+1)) { if(isloggedin(.@paid[.@i],.@pcid[.@i])&&.@pcid[.@i]!=.@cid) set(.@menu$,.@menu$+rid2name(.@paid[.@i])+":"); else { deletearray .@paid[.@i],1; deletearray .@pcid[.@i],1; set(.@i,.@i-1); set(.@len,.@len-1); } } if(.@menu$=="") end; mes "Select who you warp to!"; if(set(@menu,prompt(.@menu$)-1)>253) end; getmapxy(.@map$,.@x,.@y,0,rid2name(.@paid[@menu])); if(getmapusers(.@map$)<0) end; warp .@map$,.@x,.@y; end; } Call it like... 502,Orange_Potion,Orange Potion,0,200,,100,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(105,145),0; callfunc("warp2partymember"); },{},{} Edit--- I didn't read the request clearly and just skimmed it so this isn't exactly the NPC that you requested, but it's still a really cool utility and you should try it all the same.
×
×
  • Create New...