Jump to content

fallen0519

Members
  • Posts

    52
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by fallen0519

  1. Hi, may I ask a favor about bindatcmd, is something like players can type @joinevent, and the NPC will ask them whether want to warp to the Event Area. "Yes" or "No" as selection. Hope some pro-scripter can help me about this. Thanks much~
  2. Can someone provide me which one is the correct script, I saw 2 different edit and don't know which is the chosen working one. Especially about the On claim and On Check. OnCheck: for(set .@i,0; .@i<30; set .@i,.@i+1) deletearray .@acc[0], getarraysize(.@acc); deletearray .@char[0], getarraysize(.@char); query_sql("SELECT account_id,char_id FROM `guild_member` WHERE guild_id = '"+.@guild+"'", .@acc, .@char); for(set .@j,0; .@j<getarraysize(.@acc); set .@j,.@j+1) if (isloggedin(.@acc[.@j],.@char[.@j])) { query_sql("SELECT last_ip FROM `guild_member` WHERE account_id = '"+.@acc[.@j]+"'",.@ip1); query_sql("SELECT last_ip FROM `guild_package` WHERE account_id = '"+.@acc[.@j]+"'",.@ip2); if(.@ip1 == .@ip2) { message rid2name(.@acc[.@j]),"Sorry but you can't use cheating on this system."; sleep 1; return; } set .@members,.@members+1; sleep 1;} return; OnClaim: for(set .@i,0; .@i<30; set .@i,.@i+1) deletearray .@acc[0], getarraysize(.@acc); deletearray .@char[0], getarraysize(.@char); query_sql("SELECT account_id,char_id FROM `guild_member` WHERE guild_id = '"+.@guild+"'", .@acc, .@char); for(set .@j,0; .@j<getarraysize(.@acc); set .@j,.@j+1) if (isloggedin(.@acc[.@j],.@char[.@j])) { query_sql("SELECT last_ip FROM `guild_member` WHERE account_id = '"+.@acc[.@j]+"'",.@ip1); query_sql("SELECT last_ip FROM `guild_package` WHERE account_id = '"+.@acc[.@j]+"'",.@ip2); if(.@ip1 == .@ip2) { message rid2name(.@acc[.@j]),"Sorry but you can't use cheating on this system."; sleep 1; return; } query_sql("INSERT INTO `guild_package` (NULL,'account_id' , 'last_ip') VALUES ('.@acc[.@j]','.@ip1')"); set .@members,.@members+1; sleep 1;} return; } the other edited one OnCheck: for(set .@i,0; .@i<25; set .@i,.@i+1) query_sql("SELECT account_id,char_id FROM `guild_member` WHERE guild_id = '"+.@guild+"'", .@acc, .@char); for(set .@j,0; .@j<getarraysize(.@acc); set .@j,.@j+1) if (isloggedin(.@acc[.@j],.@char[.@j])) { query_sql("SELECT last_ip FROM `guild_member` WHERE account_id = '"+.@acc[.@j]+"'",.@ip1); query_sql("SELECT last_ip FROM `guild_package` WHERE account_id = '"+.@acc[.@j]+"'",.@ip2); goto IP_Check1; } return; IP_Check1: if(.@ip1 == .@ip2){ message rid2name(.@acc[.@j]),"Sorry but you can't cheat on this system."; } else{ set @members,@members+1; } end; OnClaim: for(set .@i,0; .@i<25; set .@i,.@i+1) query_sql("SELECT account_id,char_id FROM `guild_member` WHERE guild_id = '"+.@guild+"'", .@acc, .@char); for(set .@j,0; .@j<getarraysize(.@acc); set .@j,.@j+1) if (isloggedin(.@acc[.@j],.@char[.@j])) { query_sql("SELECT last_ip FROM `guild_member` WHERE account_id = '"+.@acc[.@j]+"'",.@ip1); query_sql("SELECT last_ip FROM `guild_package` WHERE account_id = '"+.@acc[.@j]+"'",.@ip2); goto IP_Check2; } return; IP_Check2: if(.@ip1 == .@ip2){ message rid2name(.@acc[.@j]),"Sorry but you can't cheat on this system."; } else{ query_sql("INSERT INTO `guild_package` (NULL,'account_id' , 'last_ip') VALUES (NULL,'.@acc[.@j]','.@ip1')"); set @members,@members+1; } end; } Someone please tell me which one is the error bug free one, sorry if its too much, if possible please post the full script here yea. Thanks in advance.
  3. Hello any pro scripter here, hope you can guide me whats wrong with this Guild Pack Info npc. I already execute the SQL "guildpack_guild" and "guildpack_members" and still the players with same IP will be able to obtain them. Following is the current script. // http://rathena.org/board/topic/78517-guild-pack-information-giver/ /*//========================================================== CREATE TABLE IF NOT EXISTS `guildpack_guilds` ( `guild_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', `guild_name` VARCHAR(24) NOT NULL DEFAULT '', `master_char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', `master_name` VARCHAR(24) NOT NULL DEFAULT '', `redeem_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`guild_id`) ) ENGINE=MYISAM; CREATE TABLE IF NOT EXISTS `guildpack_members` ( `guild_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', `name` VARCHAR(30) NOT NULL DEFAULT '', `ip` VARCHAR(15) NOT NULL DEFAULT '', PRIMARY KEY (`guild_id`,`char_id`), KEY `guild_id` (`guild_id`) ) ENGINE=MYISAM; //==========================================================*/ prontera,155,188,0 script Guild Pack Info 910,{ switch(select( (countitem(21001)?"I have a GM's Approval Card":"") + ":Guild List")) { case 1: // exchanging a GM's Approval Card (21001) mes "[Guild Pack Info]"; if (!getcharid(2)) { mes "^FF0000You must be in a guild to receive a guild package.^000000"; close; } else if (getcharid(0) != getguildmasterid(getcharid(2))) { mes "Please tell your guild leader ^0000FF"+getguildmaster(getcharid(2))+"^000000 to come and see me personally."; close; } else if (countitem(21001) < 1) { mes "^FF0000You don't have a GM's Approval Card to exchange.^000000"; close; } // check if guild has 10 members query_sql "SELECT char_id,account_id,`name` FROM guild_member WHERE guild_id="+getcharid(2), .@char_id,.@account_id,.@name$; if (getarraysize(.@char_id) < .guild_size) { mes "You must have ^FF0000"+.guild_size+"^000000 guild members"; mes "(1 leader + "+(.guild_size-1)+" members)."; close; } // check if all guild members are online for (set .@i,0; .@i<.guild_size; set .@i,.@i+1) { if (!isloggedin(.@account_id[.@i], .@char_id[.@i])) { mes "^FF0000"+ .@name$[.@i] +"^000000 is offline."; mes "All "+.guild_size+" guild members must be online to receive the guild package."; close; } } // check if any guild members have ALREADY obtained a guild package if (query_sql("SELECT `name`,guild_name FROM guildpack_members " + "LEFT JOIN guildpack_guilds ON guildpack_members.guild_id=guildpack_guilds.guild_id " + "WHERE account_id IN (SELECT account_id FROM guild_member WHERE guild_id="+getcharid(2)+") LIMIT 1", .@name$,.@guild$) > 0) { mes "^0000FF"+.@name$+"^FF0000 already received a guild pack while in ^0000FF"+.@guild$+"^000000."; mes "Each account can only receive a guild pack once."; close; } mes "Exchange GM's Approval Card for Guild Pack?"; if (select("No:Yes, continue") == 1) close; // #SUCCESS - passed all checks delitem 21001,1; for (set .@i,0; .@i<.guild_size; set .@i,.@i+1) { if (.@account_id[.@i] == playerattached()) { getitem 21010,1; // leader } else { getitem 21011,1, .@account_id[.@i]; // each member } } announce "Guild Pack Info : the guild ["+ strcharinfo(2) +"] has obtain a guild package.", bc_all|bc_blue; // record guild query_sql "INSERT INTO guildpack_guilds (guild_id,guild_name,master_char_id,master_name,redeem_time) VALUES " + "("+getcharid(2)+",'"+escape_sql(strcharinfo(2))+"', "+getcharid(0)+",'"+escape_sql(strcharinfo(0))+"', NOW())"; // record all guild members query_sql "INSERT INTO guildpack_members(guild_id,account_id,char_id,`name`,ip) " + "SELECT guild_id,guild_member.account_id,char_id,`name`,last_ip FROM guild_member " + "LEFT JOIN login ON guild_member.account_id=login.account_id " + "WHERE guild_id="+getcharid(2); break; case 2: // Guild List // get list of guilds query_sql "SELECT guild_id,guild_name FROM guildpack_guilds ORDER BY guild_name ASC", .@guild_id,.@guild_name$; mes "[Guild Pack Info]"; if (getarraysize(.@guild_id) == 0) { mes "No guilds have received a guild pack."; close; } for (set .@i,0; .@i<getarraysize(.@guild_id); set .@i,.@i+1) set .@menu$, .@menu$ + .@guild_name$[.@i]+":"; // pick a guild set .@GID, .@guild_id[set(.@g,select(.@menu$)-1)]; // get info for that guild query_sql "SELECT guildpack_members.char_id, CONCAT(IF(ISNULL(guild_member.char_id),'^FF0000','^008000')," + "guildpack_members.`name`), ip FROM guildpack_members " + "LEFT JOIN guildpack_guilds ON guildpack_members.guild_id=guildpack_guilds.guild_id " + "LEFT JOIN guild_member ON guildpack_members.char_id=guild_member.char_id AND guildpack_members.guild_id=guild_member.guild_id " + "WHERE guildpack_members.guild_id="+.@GID+" " + "ORDER BY (guildpack_members.char_id=master_char_id) DESC", .@char_id, .@colored_name$, .@ip$; // display guild info mes "Guild : " + .@guild_name$[.@g]; mes "Status : " + (query_sql("SELECT 1 FROM guild WHERE guild_id="+.@GID,.@i) ? "^008000Active" : "^FF0000Disbanded") + "^000000"; mes "Leader : "+.@colored_name$[0]+"^000000 ("+.@ip$[0]+")"; mes "Members :"; for (set .@i,1; .@i<getarraysize(.@char_id); set .@i,.@i+1) mes " "+(.@i+1)+". "+.@colored_name$[.@i]+"^000000 ("+.@ip$[.@i]+")"; break; } close; OnInit: set .guild_size, 10; if (query_sql("SHOW TABLES LIKE 'guildpack_guilds'", .@t$) == 0) { debugmes "[Guild Pack Info]: SQL table `guildpack_guilds` not found! Disabling npc."; disablenpc strnpcinfo(3); } else if (query_sql("SHOW TABLES LIKE 'guildpack_members'", .@t$) == 0) { debugmes "[Guild Pack Info]: SQL table `guildpack_members` not found! Disabling npc."; disablenpc strnpcinfo(3); } end; } Help please, any~~ ><
  4. How to make this Enchanted Expert NPC able to enchant all equip including mid headgears and accessories, or can anyone customize the script to be able to configure the equipment option which one to enable. Thank much, any pro scripter please help me about this. prontera,165,164,4 script Enchant Expert 626,{ mes "[Enchant Expert]"; mes "Hey, today might be your lucky day !!"; mes "Do you want to enchant your equipped armor ?"; next; mes "[Enchant Expert]"; mes "The enchant system give you a random stats from +1 to +10."; mes "Of course, the higher the stats, the lower the percentage."; next; if ( select ( "yes", "no" ) == 2 ) close; if ( !getequipisequiped( EQI_ARMOR ) ) { mes "you did not equip an armor at the moment"; close; } .@id = getequipid( EQI_ARMOR ); .@ref = getequiprefinerycnt( EQI_ARMOR ); .@card1 = getequipcardid( EQI_ARMOR, 0 ); .@card2 = getequipcardid( EQI_ARMOR, 1 ); .@card3 = getequipcardid( EQI_ARMOR, 2 ); .@card4 = getequipcardid( EQI_ARMOR, 3 ); if ( .@card1 == 255 || .@card1 == 254 ) { mes "I can't enchant a signed equipment"; close; } if ( .@card4 ) { mes "this armor has already enchanted"; close; } .@rand = rand(.totalchance); while ( ( .@rand = .@rand - .rate[.@r] ) >= 0 ) .@r++; .@o = rand(0,5); // orb of str/int/dex .... delitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 0; getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 4700 + .@o * 10 + .@r; equip .@id; close; OnInit: setarray .rate, 55,50,45,25,20,5,4,3,2,1; // rate of getting +1 is 55%, +2 is 50% .... +10 is 10% ... while ( .@i < 10 ) { .totalchance = .totalchance + .rate[.@i]; .@i++; } end; }
  5. Can anyone teach me how to extend the NPC item list because it only shows 64 items from the 100 items in script below, thanks much. yuno,24,207,5 script Costume Trader 626,{ mes .name$; mes "You currently have "+countitem(.tcg_item)+" TCG."; mes "Would you like to look at the shop?"; next; if(select("Yes:No") == 2) { close; } close2; callshop "Costume_SHOP",1; npcshopattach "Costume_SHOP"; dispbottom "You currently have "+countitem(.tcg_item)+" TCG."; end; OnBuyItem: for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) { for(set @j,0; @j < getarraysize(.TCG_ITEMS); set @j,@j+2) { if(.TCG_ITEMS[@j] == @bought_nameid[@i]) { set @itemcost,(.TCG_ITEMS[(@j+1)]*@bought_quantity[@i]); set @totalcost,(@totalcost+@itemcost); break; } } } if(@totalcost > countitem(.tcg_item)) { dispbottom "You don't have enough TCG."; } else { for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) { getitem @bought_nameid[@i],@bought_quantity[@i]; } delitem .tcg_item,@totalcost; dispbottom "Thank you for shopping."; dispbottom "You now have "+countitem(.tcg_item)+" TCG left."; } set @totalcost,0; deletearray @bought_nameid[0],128; deletearray @bought_quantity[0],128; end; OnInit: npcshopdelitem "Costume_SHOP",7227; // Leave this alone set .name$,"[Costume Trader]"; set .tcg_item,7227; // Input TCG ID setarray .TCG_ITEMS[0],29801,100,29802,100,29806,100,29807,100,29812,100,29814,100,29816,100,29819,100,29820,100,29824,100,29825,100,29827,100,29828,100,29830,100,29831,100,29832,100,29833,100,29836,100,29837,100,29839,100,29840,100,29843,100,29847,100,29848,100,29851,100,29852,100,29853,100,29855,100,29856,100,29857,100,29858,100,29859,100,29861,100,29863,100,29864,100,29865,100,29867,100,29869,100,29871,100,29873,100,29875,100,29884,100,29885,100,29886,100,29890,100,29891,100,29893,100,29896,100,29897,100,210000,100,29810,100,29815,100,29834,100,29838,100,29850,100,29868,100,29879,100,29882,100,29883,100,29887,100,29888,100,29889,100,29803,100,29804,100,29805,100,29808,100,29809,100,29811,100,29813,100,29817,100,29818,100,29821,100,29822,100,29823,100,29826,100,29829,100,29835,100,29841,100,29842,100,29844,100,29845,100,29846,100,29849,100,29854,100,29860,100,29862,100,29866,100,29870,100,29872,100,29874,100,29876,100,29877,100,29878,100,29880,100,29881,100,29892,100,29894,100,29895,100,29898,100,298100,100; // Input as many items as you want (item::price) for(set .@i,0; .@i < getarraysize(.TCG_ITEMS); set .@i,.@i+2) { npcshopadditem "Costume_SHOP",.TCG_ITEMS[.@i],.TCG_ITEMS[(.@i+1)]; } } - shop Costume_SHOP -1,7227:1
  6. I am using r17704, I see that ninja Final Strike damage is bug, whenever your vit is 1 or 9999 the damage didn't increase, since the description written increase while the NINJA hp increasing. Following is the src code for skills. Can anyone tell me how to fix this? Hmm..... #else case NJ_ISSEN: wd.damage = 40 * sstatus->str + (8 / 100) * skill_lv * sstatus->hp; wd.damage2 = 0; break; case LK_SPIRALPIERCE: case ML_SPIRALPIERCE: if (sd) { short index = sd->equip_index[EQI_HAND_R]; if (index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_WEAPON) wd.damage = sd->inventory_data[index]->weight*8/100; //80% of weight ATK_ADDRATE(wd.damage, wd.damage2, 50*skill_lv); //Skill modifier applies to weight only. } else { wd.damage = battle_calc_base_damage(sstatus, &sstatus->rhw, sc, tstatus->size, sd, 0); //Monsters have no weight and use ATK instead } i = sstatus->str/10; i*=i; ATK_ADD(wd.damage, wd.damage2, i); //Add str bonus. switch (tstatus->size) { //Size-fix. Is this modified by weapon perfection? case SZ_SMALL: //Small: 125% ATK_RATE(wd.damage, wd.damage2, 125); break; //case SZ_MEDIUM: //Medium: 100% case SZ_BIG: //Large: 75% ATK_RATE(wd.damage, wd.damage2, 75); break;
  7. I found a MVP Rank script and it gives Monthly Reward for the top players, where to edit the players to top 10 and make it per week reward instead of per month, thank you. One more stupid question yea, sorry for being noob, what is the meaning of, alter table `char` add column mvp_rank int(11) default 0 after delete_date, add index (mvp_rank); How to do it in sql table for the top part, I just know to execute the following, create table mvp_rank_archive ( `date` datetime, pos tinyint(4) unsigned, cid int(11) unsigned default 0, name varchar(23) default '', points int(11) unsigned not null, primary key ( `date`, pos ) ) engine innodb; /* alter table `char` add column mvp_rank int(11) default 0 after delete_date, add index (mvp_rank); create table mvp_rank_archive ( `date` datetime, pos tinyint(4) unsigned, cid int(11) unsigned default 0, name varchar(23) default '', points int(11) unsigned not null, primary key ( `date`, pos ) ) engine innodb; */ prontera,158,183,3 script MVP Ladder 100,{ mes "[MVP Ladder]"; mes "Hello!"; mes "What are you doing here?"; next; switch(select("Check rankings.:My stats.:Previous Month ranking")) { case 1: mes "[MVP Ladder]"; mes "Rankings :->"; .@nb = query_sql( "select name, mvp_rank from `char` where mvp_rank > 0 order by mvp_rank desc limit 10", .@name$, .@count ); if ( !.@nb ) { mes "no entry"; close; } for ( .@i = 0; .@i < .@nb; .@i++ ) mes ( .@i +1 )+". "+ .@name$[.@i] +" -> "+ .@count[.@i] +" points"; close; case 2: query_sql "select mvp_rank from `char` where char_id = "+ getcharid(0), .@killed; mes "[MVP Ladder]"; mes "You have killed "+ .@killed +" MVPs"; close; case 3: mes "[MVP Ladder]"; mes "Last month ranking"; if ( gettime(6) > 10 ) .@store_date$ = gettime(7) +"-"+( gettime(6) -1 )+"-00 00:00:00"; else if ( gettime(6) > 1 ) .@store_date$ = gettime(7) +"-0"+( gettime(6) -1 )+"-00 00:00:00"; else .@store_date$ = ( gettime(7) -1 ) +"-12-00 00:00:00"; .@nb = query_sql( "select name, points from mvp_rank_archive where `date` = '"+ .@store_date$ +"' order by pos", .@name$, .@count ); if ( !.@nb ) { mes "no entry"; close; } for ( .@i = 0; .@i < .@nb; .@i++ ) mes ( .@i +1 )+". "+ .@name$[.@i] +" -> "+ .@count[.@i] +" points"; close; } close; OnInit: if ( $mvp_ladder_last_given == atoi( gettime(7) +""+ gettime(6) ) ) end; goto L_give; OnClock0000: if ( gettime(5) != 1 ) end; L_give: .@nb = query_sql( "select char_id, name, mvp_rank from `char` where mvp_rank > 0 order by mvp_rank desc limit 10", .@cid, .@name$, .@killed ); if ( !.@nb ) end; setarray .@reward, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510; setarray .@amount, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1; for ( .@i = 0; .@i < .@nb; .@i++ ) query_sql "insert into mail ( send_name, dest_id, title, message, nameid, amount, identify, zeny, time ) values ( '"+ escape_sql( .@name$[.@i] ) +"', "+ .@cid[.@i] +", '[MVP RANK]', 'Congratulations for earning No. "+( .@i +1 )+" position in MVP rank. Here is your reward.', "+ .@reward[.@i] +", "+ .@amount[.@i] +", 1, 0, unix_timestamp( now() ) )"; if ( gettime(6) > 10 ) .@store_date$ = gettime(7) +"-"+( gettime(6) -1 )+"-00 00:00:00"; else if ( gettime(6) > 1 ) .@store_date$ = gettime(7) +"-0"+( gettime(6) -1 )+"-00 00:00:00"; else .@store_date$ = ( gettime(7) -1 ) +"-12-00 00:00:00"; for ( .@i = 0; .@i < .@nb; .@i++ ) .@store$[.@i] = "( '"+ .@store_date$ +"', "+( .@i +1 )+", "+ .@cid[.@i] +", '"+ escape_sql( .@name$[.@i] ) +"', "+ .@killed[.@i] +" )"; query_sql "insert into mvp_rank_archive values "+ implode( .@store$, "," ); query_sql "update `char` set mvp_rank = 0"; // reset the ladder $mvp_ladder_last_given = atoi( gettime(7) +""+ gettime(6) ); end; OnNPCKillEvent: if ( getmonsterinfo( killedrid, MOB_MVPEXP ) ) { query_sql "update `char` set mvp_rank = mvp_rank +1 where char_id = "+ getcharid(0); query_sql "select mvp_rank from `char` where char_id = "+ getcharid(0), .@killed; dispbottom "~ You've killed "+ .@killed +" MVP. ~"; specialeffect2 EF_HEAL2; } end; }
  8. Sorry Patskie, I did try to change to .register_count++; but still the WINNER will be the second player. Let me explain how the 2nd player won. Player A and Player B join the event, Player B die from the Bomb Poring and shows (Return to Save Point) (Exit Game), that's why he can watch the other players who is playing still. When left only Player A in the event, when Player A died, automatic warped to the save point. Player B will automatically got the reward as Last Man Standing. I don't know how to solve it, hope anyone can help me wit this script.
  9. This is my current edit Referral NPC script. - NOT MY SCRIPT - Referral script checked with IP Based - Players can get the reward after players had play for certain days/hours - Player only can get the reward once, like (A invited B to join the server, A got the reward afterwards, While A invited C join the server, A can't claim the rewards, the NPC tell the players had claimed the reward previously) Anyone can help me to fix this NPC to be able to claimed it unlimited times whenever they invite other friends please !! Please help me !! Thank you !! //===== eAthena Script ================================================================================ //= Referral System //===== By: =========================================================================================== //= rahuldev345 //===== Current Version: ============================================================================== //= V.1 //===== Compatible With: ============================================================================== //= eAthena SVN, SQL Only //===== Description: ================================================================================== //= Referral System Working: /* Player A : Old player (Invited player B and C) Player B and C : New comers 1: As Player B and Player C logs in, they need to find npc "Referral Npc" and must Sign with NPC by choosing option "- My Friend Called me!" and Enter the exact name of his friend and then complete process by choosing option "Complete the process". 2: The Player will be asked to Relog to Start with the System. 3: As he relog, a timer will start attaching to player and it will run till he completes his todays work, i.e Play/ Stay online for 5 Hours at your server.(as per below con- figuration, can be changed according to needs). ********************************************************\ set $@hourstoplay, 5; // No. of hours to play everyday. \******************************************************* 4: But, the reward wont be given just yet, the NPC will do constant checking, to see whether players B and C are active, for at least *days( Depends on you. ). Being active means, any(or) all of these; * Logs in and plays atleast X (won't mention this) hours a day. * The npc keeps checking IP's Everytime the players logs in, ( You can set the no. of octets you want to check of ip-address ) Eg; Referrals starting with first 3 octets being the same, ex: 204.152.10.25 and 204.152.10.75, won't count and it will dispbottom the warning. 5: If they meet all those requirements, the inviter, will be rewared with some items. */ //===== Additional Comments: =========================================================================== //= Let me know, if you find any bugs. //===== Changelogs: ==================================================================================== // V.2 (a) Now the npc name is more suitable to edit. // ( Now Recruits can't enter new players name than him. - thanks to Topher08 for pointing that out. // V.3 (a) Prevent players those who completed job, but still able to apply as recruits. //====================================================================================================== // - SQL TABLE /* CREATE TABLE IF NOT EXISTS `callfrnd` ( `id` int(11) NOT NULL auto_increment, `account_id` int(11) NOT NULL default '0', `name` varchar(23) NOT NULL default '', `last_ip` varchar(100) NOT NULL default '', `last_ip2` varchar(100) NOT NULL default '', `ref_name` varchar(23) NOT NULL default '', `ref_id` int(11) NOT NULL default '0', `mins` tinyint(3) unsigned NOT NULL default '0', `days` tinyint(3) unsigned NOT NULL default '0', `task_end` tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (`account_id`), KEY (`id`) ) ENGINE=MyISAM; */ //====================================================================================================== //====================================================================================================== // Edit Configurations here: //====================================================================================================== - script Ref_config -1,{ OnInit: set $@daystoplay, 1; // total no of days to play. set $@noofplayers, 1; // min. no. of players to call to server to be eligible to get the price. set $@hourstoplay, 1; // No. of hours to play everyday. set $@noofoctet, 3; // No. of octects, that script will check. set $@new_aid, 2000000; // To be sure that the player is really new to server. Put the latest registered account id here. set $@name$,"^E41B17[Call Your Friend]^000000"; // Edit npc name here. end; } //====================================================================================================== // The main NPC: //====================================================================================================== prontera,141,173,5 script Referral Friends 549,{ mes $@name$; mes "^616D7EI am one of the staff members of GM Team. And i am assigned to award players who bring players to our server and contribute to server population."; mes " "; next; mes $@name$; mes "^616D7ESo, How may I help you?"; next; switch(select("- My Friend Called me!:- I have called My Friend's:- Close")) { mes $@name$; case 1: if ( getcharid(3) < $@new_aid ) { mes "^616D7EYou doesn't seems to be new to server."; close; } mes "^616D7EOh.. Nice, so would you like to proceed with the Referral System?"; switch(select("Yes")) { case 1: if (#CallFrnd >= 1) { mes "^616D7EYou are already Registered on our database."; close; } goto ReferralSystem; } case 2: if ( #YCallFrnd ) { mes "^0000ffThanks! for supporting our server."; close; } query_sql("SELECT count(ref_id) from `callfrnd` where ref_id = " + getcharid(3) + " AND task_end = 1",.@count); if(.@count >= $@noofplayers) { mes "^616D7ECongratulations, It seems you have Recruited [^880000 " + .@count + " ^000000] Players, to our server."; next; set #YCallFrnd, 1; mes $@name$; mes "^616D7EAll Process has been completed successfully. Now you are eligible to get the 200 TCG Card from the Referral Award Shop."; mes " "; mes "^616D7EHave a pleasent Stay at our server.!"; close; } mes "^616D7ENot Enough Recruitment's. Work Hard."; close; case 3: mes "^616D7EI wish!, if you could have helped me. :("; close; } end; ReferralSystem: next; mes $@name$; mes " "; mes "^ff0000NOTE: ^000000^616D7EThe Entered Name should match with your friend's name or he won't get the prize."; mes " "; mes "^616D7EEnter your Friend name: "; next; input .@frnd$; if ( .@frnd$ == strcharinfo(0) ) { mes $@name$; mes "^616D7ESorry, you are not allowed to Enter your name."; close; } mes $@name$; mes "^616D7ESo you have been called by [ ^ff000f" + .@frnd$ + "^000000 ]? ^616D7EIs that right??"; next; if(select("Yes:Back")==2) goto ReferralSystem; mes $@name$; mes "^616D7EIf you play more than [ ^2B60DE" + $@daystoplay + " days ^000000] and spend more than x hours to our server every day. Your friend will get a reward from the Referral Shop."; next; switch(select("Next:Show me the item List")) { case 1: break; case 2: mes $@name$; mes "^616D7ETalk to my Neighbour Npc to check the Item Reward Or Read forums."; close; } mes $@name$; mes "^616D7EAnd, if you Call your [ ^2B60DE" + $@noofplayers + " Friends ^000000] to our server, and they play more than [ ^2B60DE" + $@daystoplay + " days ^000000] and x no. of hours every day. Then you will also have a chance to win a Free Reward."; next; mes $@name$; mes "^616D7EIts, Just that you need to follow some rules: "; mes " "; next; switch(select("Exit:Complete the process")) { case 1: mes $@name$; mes "^616D7ENevermind~, You can come back again!"; close; case 2: query_sql("SELECT last_ip FROM `login` WHERE account_id = "+getcharid(3)+"", .@lastip$); // recruits ip address set .@frnd, query_sql ("SELECT name, char.account_id, last_ip FROM `char` LEFT JOIN `login` ON login.account_id = char.account_id where name = '" + escape_sql(.@frnd$) + "'",.@chname$, .@account_id, .@flastip$); // recruiter ip address and information if (!.@frnd) { mes $@name$; mes "^ff0000FAILED! FAILED! FAILED!"; mes " "; mes "^616D7ESorry, We didn't found your friend's name in our database. Make sure that you Enter's Everything correctly."; close; } if ( .@account_id == getcharid(3) ) { mes $@name$; mes "^ff0000WARNING: ^616D7EThis Player is found on your account. Sorry, Unable to proceed further!!!"; mes " "; mes "Enter some other name"; close; } if ( .@account_id > getcharid(3) ) { // i am older than my frnd mes $@name$; mes "^616D7EIt seems, your friend is newer than you to our server. Damn you cheaters. "; close; } if ( .@lastip$ == .@flastip$ ) { mes $@name$; mes "^616D7EIt seems you and your friend are from IP Address: ^ff0000" + .@flastip$ + "^000000. Sorry, but its not allowed."; close; } set #CallFrnd, 1; query_sql("INSERT INTO `callfrnd` VALUES (NULL," + getcharid(3) + ",'" + escape_sql(strcharinfo(0)) + "','" + .@lastip$ + "','None','" + escape_sql(.@frnd$) + "'," + .@account_id + ",0,0,0)"); mes $@name$; mes "^616D7EYour registration is now accepted."; mes "^ff0000Now, you should relog to make changes save and start properly.^000000"; mes " "; mes "and ^0000ff~ We Welcome's you to our server."; close; } } //====================================================================================================== // Keep Checking Records and performs accordingly. //====================================================================================================== - script timeplayed -1,{ OnPCLoginEvent: if (#CallFrnd != 1) end; // Task still not started or is completed query_sql("SELECT ref_id, mins, days from `callfrnd` where account_id = " + getcharid(3), @ref_id, @minute, consecutive_days); query_sql("SELECT SUBSTRING_INDEX(last_ip,'.'," + ($@noofoctet) + ") from `login` where account_id = " + @ref_id,.@fip$); query_sql("SELECT SUBSTRING_INDEX(last_ip,'.'," + ($@noofoctet) + ") from `login` where account_id = " + getcharid(3),@myip$); if((#lastDayOnlineC == gettimetick(2)/86400)) end; // If today's job is completed or not. if( #lastDayOnlineC < ((gettimetick(2)/86400)-1) ) { // if login was not yesterday set consecutive_days, 0; set @minute, 0; goto TimerStart; } if( #lastDayOnlineC == ((gettimetick(2)/86400)-1) ) { // if login was yesterday goto TimerStart; } TimerStart: if(.@fip$ == @myip$) { dispbottom "Referral system Stopped because you and your friend(s) ip is same."; end; } attachnpctimer ""+strcharinfo(0); initnpctimer; end; OnTimer30000: if(checkvending() == 1 || checkchatting() == 1) { //Check if Vending or chatting dispbottom "The timer stopped because you are vending/chatting. Please relog if you wish to start again."; stopnpctimer; end; } getmapxy( .@map$, .@x, .@y, 0 ); //Check if Idle if(@map$ == .@map$ && @x == .@x && @y == .@y) { set @afk, @afk + 1; } else { set @afk, 0; } set @map$, .@map$; set @x, .@x; set @y, .@y; if(@afk == 5) { // if afk for 5 mins reduce 4 mins from their total minutes. set @minute, @minute - 4; dispbottom "The timer stopped because you were Idle for 5 minutes. Please relog if you wish to start again."; stopnpctimer; end; } end; OnTimer60000: //Check every 1 Minute set @minute, @minute + 1; if(@minute == ($@hourstoplay*60)) { set @minute,0; query_sql("UPDATE `callfrnd` SET days = (days+1) WHERE account_id = " + getcharid(3) +";"); set #lastDayOnlineC, gettimetick(2)/86400; set consecutive_days, consecutive_days +1; if( consecutive_days == $@daystoplay ) { set #CallFrnd, 2; query_sql("UPDATE `callfrnd` SET task_end = 1 WHERE account_id = " + getcharid(3) +";"); stopnpctimer; end; } end; } initnpctimer; end; OnPCLogoutEvent: if (#CallFrnd != 1) end; query_sql("INSERT INTO `callfrnd` (id,account_id,mins) VALUES (NULL," + getcharid(3) + ","+@minute+") ON DUPLICATE KEY UPDATE account_id= " + getcharid(3) + ",last_ip='"+@myip$+"',mins="+@minute); end; } //====================================================================================================== // Shop NPC: // NOTE: This npc lets you buy only one item of quantity one. //====================================================================================================== prontera,139,173,5 script Referral Prize 495,{ if(#YCallFrnd == 1) { mes "[ " + strnpcinfo(3) + " ]"; getitem .item,.qty; set #YCallFrnd, 2; mes "Thanks!"; close; } else { mes "[ " + strnpcinfo(3) + " ]"; mes "What? " + ((#YCallFrnd==0)? "you haven't Referred anyone to our server.":"you have alredy Received the price."); close; } OnInit: npcshopattach "Ref#shop1"; set .item,12152; // Item id set .qty,1; // Quantity end; }
  10. This is an automated event "Run or Die" event, I think there is something wrong with the script, whenever the last winner won, the prize goes to the 2nd players, whats wrong with the script, can anyone check it our for me please, hope there is pro scripter who can help me fix the script. Thank you. prontera,150,138,5 script Run Or Die 461,{ if ( !.start ) { mes "no event atm"; close; } if ( .start == 2 ) { mes "event is running"; close; } if ( .register_count >= .register_limit ) { mes "this event has reach the maximum player participations"; close; } percentheal 100,100; warp .map$, 0,0; .register_aid[ .register_count ] = getcharid(3); .register_count+++; end; OnCommand: OnClock1230: // put all your start timer here OnClock1430: OnClock1630: OnClock1830: if ( .start ) end; announce "Run or Die event registration start", bc_all; .start = 1; sleep 50000; // registration timer here announce "Run or Die event registration close", bc_all; .start = 2; sleep 3000; mapannounce .map$, "Survive as long as you can !", bc_map; if ( .register_count < .register_min ) { announce "Not enough participants for Run or Die event", 0; getmapxy .@map$, .@x, .@y, 1; mapwarp .map$, .@map$, .@x, .@y; goto L_reset; } while ( .start == 2 ) { monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 0; monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 1; monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 2; sleep 5000; } end; OnPCDieEvent: OnPCLogoutEvent: if ( !.start || strcharinfo(3) != .map$ ) end; while ( .register_aid != getcharid(3) && .@i < .register_count ) .@i++; if ( .@i == .register_count ) end; deletearray .register_aid[.@i], 1; .register_count--; warp "SavePoint", 0,0; if ( .register_count > 1 ) end; killmonsterall .map$; announce "Congratulations ~ the winner of Run Or Die event got 3 TCG Card. - "+ rid2name( .register_aid ), bc_all; getitem .reward_item_id, .reward_item_amount, .register_aid; // winner prize warpchar "SavePoint", 0,0, getcharid( 0, rid2name( .register_aid ) ); L_reset: deletearray .register_aid; .start = .register_count = 0; end; OnInit: .map$ = "guild_vs5"; .register_min = 1; // minimum amount of players to start this event, or else it auto-abort .register_limit = 100; // maximum amount of players able to participate in this event .reward_item_id = 7227; // reward item id .reward_item_amount = 3; // reward item amount to the sole winner bindatcmd "runordie", strnpcinfo(0)+"::OnCommand", 99,99; end; } guild_vs5 mapflag nosave SavePoint guild_vs5 mapflag nowarp guild_vs5 mapflag nowarpto guild_vs5 mapflag noteleport guild_vs5 mapflag nomemo guild_vs5 mapflag nopenalty guild_vs5 mapflag noicewall //guild_vs5 mapflag nobranch
  11. Bump !! Please anyone could help me please..~~ Thanks
  12. Sir Emistry, can I have the full script please, I afraid that I make some tiny mistake and cause it error again. Is it replace them or something? hmmmmm.... much appreciated~
  13. I try the following script first, see if it cause the same problem or not. Thanks for helping, get back to you ASAP !!
  14. Whenever I use a command like go back to Prontera city, it keep appearing. Example: @go 0 ...Putty will appear again. Have no idea how to fix it. Please help me sir. =x
  15. Not about tab-ing, I ald did it, must be some other issue... Anyone help me about this please, I don't know how to fix this problem, is the debug things related to the problem occured? Hmm............. Help any pro scripter here....><
  16. I am currently getting this error: [Warning]: script:getelementofarray: index out of range (-1) [Debug]: Data: variable name='.tmp$' index=0 [Debug]: Source (NPC): dualclientkicker (invisible/not on a map) And here is the script: Sorry but I'm kind of new in eA scripting. I mean I never studied the language. - script dualclientkicker -1,{ OnPCLoadMapEvent: set .@charmap$, strcharinfo(3); query_sql("SELECT FIND_IN_SET('"+.@charmap$+"', '"+.maps$+"');",.@q); if(.@charmap$!=.tmp$[(.@q-1)]) 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); if(.@len-1) { for(set(.@d,0);.@d<.@len;set(.@d,.@d+1)) { getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d])); if(.tmp$[(.@q-1)]==.@map$&&rid2name(.@a[.@d])!=strcharinfo(0)) { dispbottom "Dual accounts not allowed in HERE."; warp "prontera",156,173; } } } end; OnInit: set .maps$ ,"bat_a01,bat_room,guild_vs3,pvp_y_5-1"; explode(.tmp$,.maps$,",") ; set .lens , getarraysize(.tmp$); for(set .a,0;.a<.lens;set .a,.a+1) setmapflag .tmp$[.a], mf_loadevent; }
  17. How to make this script IP check yea? Does it need to do something like executing sql? hopefully can just edit the script. Anyone guys? Hmmmmmmmmmm
  18. I also plan to use this daily reward script, may I ask which version is the most stable 1? Isiti 1.48 ver? And 1 more thing, is this script ald made as IP based like acc with the same IP can't get the daily reward when they trying to abuse.
  19. I am using this Daily reward which apply 7 days different reward, but how to make it like IP check, so players cant abuse by using this script. Thanks and waiting for someone to help~
  20. This is my npc/custom/battleground/bg_emp.txt script
  21. Sorry about that, I am kinda noob in editing a script, where should I paste your following copy, make a new script? or posting to somewhere its ald there. Hmm.....
  22. I am not sure what is your question, Its by default of the SGCP setting, I nvr touch it, but after people met that character log out error, they just need to reset the position like "Reset char to save position" and then they are able to log in to the game. Btw, I am using Nickyzai kro client ........kRO & Renewal Full Client 2013-12-01 Ang one more thing, there is non error issue in my putty, thats why I'm having trouble to fix this. Hope you can help me about this problem that I am facing. =x
  23. Is there any way to make the chat room IP Check? because my players abusing the default rAthena custom BG which kill opponent flag to win, When i set the map IP restriction, Example 3v3, 5 of them will be kicked out to Prontera, and yet 1 of the players can just kill the flag to get the reward, anyone ca help me about this? If the chat room is IP restriction, people will be fail to using multiple client while playing BG. Thanks~
×
×
  • Create New...