Jump to content

Skorm

Forum Moderator
  • Posts

    1282
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Skorm

  1. You don't think I understood what you said? I understand clearly what you were trying to convey. I also understand exactly where, 2essy2killu, was coming from, because standard custom OnEvents don't pass killedrid so in his script he HAS to use OnNPCKillEvent:. He had no other option and as I've demonstrated his script was clearly a path to a much more dynamic OnDeath event, and I don't think he should be so heavily criticized for it.
  2. Skorm

    server time

    prontera,167,196,3 script nRO Server Time 864,{ end; OnInit: while( 1 ){ delwaitingroom; waitingroom " "+gettimestr( "%r",21 ),0; sleep 1000; } end; }
  3. Like Jasc said I think ya'll way to hard on him. prontera,100,100,110,110 monster Poringz0rd 1002,1,1,1,"MVPTrigger::OnBossDeathEvent" - script MVPTrigger -,{ OnBossDeathEvent: query_sql("SELECT FIND_IN_SET('"+killedrid+"', '"+.bossid$+"');"),.@result$; set .@a, atoi(.@result$)-1; if(.@a!=-1) getitem .reward[.@a],.amount[.@a]; end; OnInit: set .bossid$, "1002,1006,1007,1008,1009"+ "1010,1011,1012,1013,1014"; setarray .reward, 607, 608, 609, 610, 611, 612, 613, 614, 615, 617; setarray .amount, 5 , 10 , 12 , 14 , 16 , 30 , 2 , 1 , 22 , 8 ; } You can add killedrid to custom monster events if you do this simple mod. http://rathena.org/board/tracker/issue-7817-onmobdeathevents/
  4. Try: Add in Ragnarok Server\trunk\conf\mapflag\restricted.txt poring_c01 mapflag restricted 8 Add in Ragnarok Server\trunk\db\re\skill_nocast_db.txt 143,4096 //NV_TRICKDEAD,Play Dead
  5. Before your close add I think it is... cutin "",255;
  6. //===== Hourly Points Script ========================================= //===== By: ========================================================== //= GorthexTiger modified by Nibi //===== Current Version: ============================================= //= 1.0 //===== Compatible With: ============================================= //= Any eAthena Version //===== Description: ================================================= //= Get Points every successful hours of gameplay, you cannot get //= the points even if you miss a second or a minute. A player will //= get a very big bonus if they played 3 hours consecutively //= or without logging out of the game. If the player is vending //= the script will then stop. //===== Additional Comments: ========================================= //= You can modify the script to your liking. //= The default points is Kafrapoints change it anyway if you like. //= 1.1 = Check Chatting too //= 1.2 = 5 Minute Idle Check & @at/@autotrade check. //= 1.3 = Corrected the current balance line on 12 Hours Consecutive //==================================================================== - script hourlypoints -1,{ //--Start of the Script OnPCLoginEvent: addtimer .timer,"hourlypoints::OnPointGet"; end; OnPointGet: while(checkvending() >= 1 || checkchatting() == 1 || checkidle()>=.dlimit) { sleep2 .delay; if(.@mes$=="") dispbottom set(.@mes$,"The hourly points event haulted because you were vending, chatting, or idle."); } set #KAFRAPOINTS, #KAFRAPOINTS + .point_amt; dispbottom "You received "+.point_amt+" Kafrapoints by staying ingame for 1 hour"; dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints"; set @consecutive_hour, @consecutive_hour + 1; //Check for 3 hours consecutive if(@consecutive_hour == 3) { set @consecutive_hour,0; set #KAFRAPOINTS, #KAFRAPOINTS + .cpoint_amt; dispbottom "You receive "+.cpoint_amt+" Kafrapoints in playing for 12 consecutive hours"; dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints"; } addtimer .timer,"hourlypoints::OnPointGet"; end; OnInit: set .timer, 1000*60*60; //Timer in milliseconds. set .cpoint_amt, 50; //Points gained for consecutive time online. set .point_amt, 10; //Normal points gained. set .delay, 1000; //Delay for idle re-check check. set .dlimit, 60*5; //Stop points if afk greater then in seconds. } I'm not sure if Hercules has all the fancy commands that rAthena does, but they really make something like this easier...
  7. Gotta say I love this one, Mr. DE, makes me smile when I see it. (20/10)
  8. If you want it exclusive to chat rooms on specific maps leave it as is. if you want it to work in chat rooms on any map change it to. !compare(.maps$,strcharinfo(3)) || !checkchatting() Although I really don't know if whisper events work from inside chat rooms to begin with.
  9. 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
  10. I've noticed eAthena has problems with the whisperglobal on timers and stuff... Try after the whisper part detaching and re-attaching the rid of the player... set .@a, getcharid(3); detachrid; attachrid(.@a);
  11. http://code.google.com/p/ea-addicts/downloads/detail?name=gmprotectsql.txt&can=2&q= I have a script like this already. To stop canceling it with alt keys mute the player and then detach the player from the script and unmute them from the npc. I think there was a different way of doing it but I forget. You don't have to use mine but you can learn from it I'll try yours first and I'll see what I should adjust for my server's needs. This works on rAthena right? Yeah
  12. http://code.google.com/p/ea-addicts/downloads/detail?name=gmprotectsql.txt&can=2&q= I have a script like this already. To stop canceling it with alt keys mute the player and then detach the player from the script and unmute them from the npc. I think there was a different way of doing it but I forget. You don't have to use mine but you can learn from it
  13. Thanks for the feedback I'll look at it when I get a chance. Edit: If you do @gscurb alone it resets the password you need to use it like. @gscurb > 10
  14. I think the top centered text is bland, and needs style. The character to the right could be of a higher quality. SpadeGFX, in the bottom left is too big and intrusive. 6/10
  15. http://rathena.org/board/topic/82997-guild-warehouse-w-passwordposition-based-restrictions/ Something like that?
  16. You just want to clear the map right? Because I could interpret that multiple ways. OnMinute00: mapwarp "sec_in02","prontera",156,191; sec_in02,151,162,0 script School of Fish#h1-1::fish 844,{ if (isequipped(2764)) && (isequipped(2775)){ specialeffect2 EF_BUBBLE; set .@fcast,15; if (isequipped(2550)) { //Fisher's_Muffler set .@fcast,.@fcast - 3; } if (isequipped(2443)) { //Fish_Shoes set .@fcast,.@fcast - 2; } progressbar "ffffff",.@fcast; if (rand(1,70) == 2) { getitem 7227,10; //TCG specialeffect EF_BUBBLE; mapannounce "sec_in02","" + strcharinfo(0) + " has caught a TCG CARD 10X!!!",bc_map,"0xff77ff"; end; } set .@rhea_ran,rand(1,70); if (.@rhea_ran < 20) { getitem 607,1; //yggdrasil } else if (.@rhea_ran == 20) { getitem 608,1; //yggdrasilseed } else if (.@rhea_ran == 21) { getitem 608,1; //yggdrasilseed } else if (.@rhea_ran == 22) { getitem 12111,1; //Bundle Of Food } else if (.@rhea_ran == 23) { getitem 956,1; //Gill } else if (.@rhea_ran == 24) { getitem 985,1; //Elunium } else if (.@rhea_ran == 25) { getitem 984,1; //Oridecon } else if (.@rhea_ran == 26) { getitem 607,1; //Yggdrasil } else if (.@rhea_ran == 27) { getitem 608,1; //yggdrasil seed } else if (.@rhea_ran == 28) { getitem 984,1; //Oridecon } else if (.@rhea_ran == 29) { mes "A merman pulled you into the water."; close2; sleep2 2000; specialeffect2 611; warp "iz_dun05",142,93; end; } else if (.@rhea_ran == 30) { mes "A Merman Caught your Lure"; mes "Lure Is lost"; delitem 2775, 1; close2; specialeffect2 611; end; } else if (.@rhea_ran == 31) { mes "You managed to catch something, but it was too heavy for your pole"; mes "to endure. The Pole you were using snapped in half."; delitem 2764, 1; close2; specialeffect2 611; end; } else if ((.@rhea_ran > 31) && (.@rhea_ran < 40)) { getitem 607,5; //YggDrasil } else { mes "Nothing was caught."; close; } if (rand(1,400) == 3) { getitem 20027,1; //New Red Valkyrie Helm mapannounce "sec_in02","" + strcharinfo(0) + " has caught a New Red Valkyrie Helm",bc_map,"0x00ffff"; } if (rand(1,150) == 3) { getitem 14232,2; //Yggdrasil Box(10) mapannounce "sec_in02","" + strcharinfo(0) + " has caught an Yggdrasil Box(10) 2x!!",bc_map,"0x00ffff"; } if (rand(1,400) == 3) { getitem 20048,1; //Red Dark Lord Helm mapannounce "sec_in02","" + strcharinfo(0) + " has caught an Red Dark Lord Helm!!",bc_map,"0x44ff44"; } end; } else { mes "Fish are swimming in the water."; close; } } //--------------------- //Edit duplicates here! //-------------------- sec_in02,151,158,5 duplicate(fish) School of Fish#h2-1 844 sec_in02,154,156,5 duplicate(fish) School of Fish#h3-1 844 sec_in02,157,156,5 duplicate(fish) School of Fish#h4-1 844 sec_in02,161,157,5 duplicate(fish) School of Fish#h5-1 844 sec_in02,157,159,5 duplicate(fish) School of Fish#h6-1 844 sec_in02,155,161,5 duplicate(fish) School of Fish#h7-1 844 sec_in02,154,168,5 duplicate(fish) School of Fish#h8-1 844 sec_in02,158,167,5 duplicate(fish) School of Fish#h9-1 844 sec_in02,156,164,5 duplicate(fish) School of Fish#h10-1 844 sec_in02,152,158,5 duplicate(fish) School of Fish#h11-1 844 sec_in02,163,155,5 duplicate(fish) School of Fish#h12-1 844 sec_in02,164,159,5 duplicate(fish) School of Fish#h13-1 844 sec_in02,151,167,5 duplicate(fish) School of Fish#h14-1 844 // WARPER prontera,147,163,4 script Fishing Warper 899,{ mes "[Fishing Warper]"; mes "Halo,.. Kami akan membawa anda ketempat Pemancingan"; next; menu "Let's Go",L_TELEPORT,"No thanks",L_Bye; close; OnInit: waitingroom "[Kolam Pemancingan]",0; end; L_TELEPORT: mes "Ok... Tunggu sebentar"; next; warp "sec_in02",132,161; end; L_Bye: mes "Ok... Kami tunggu kedatangannya"; close; OnMinute00: mapwarp "sec_in02","prontera",156,191; } // Exit to Prontera sec_in02,136,152,5 script Back Maincity 443,{ warp "prontera.gat" ,155,176; }
  17. Not a problem. set #ticker, gettimetick(2)+60*60*24*7; #ticker -> Is a permanent account based variable. gettimetick(2) -> UNIX epoch time (number of seconds elapsed since 1st of January 1970) + -> Plus 60 -> 60 Seconds * -> Times 60 -> 60 Minutes 24 -> 24 Hours 7 -> 7 Days All adds up to the amount of seconds in one week. Which I then added to Unix time. If the current time in seconds is greater than #ticker then the amount of time needed has passed. It's a very simple type of timer. I guarantee anywhere you go you'll be able to find it. Hope I was able to explain it well enough.
  18. Skorm

    Any tip?

    I suggest saving the winning characters to an NPC based array... //deletearray .event_winner[0],128; poring_w02,101,86,3 script Password Event NPC 405,{ if ( $event_run > 0 ) goto event_start; if ( getgmlevel() != 99 ) { mes "[Password Event NPC]"; mes "There is no on-going event as of the moment."; next; mes "[Password Event NPC]"; mes "I will inform you when a GM hosts this event."; close2; emotion e_heh; end; } mes "[Password Event NPC]"; mes "Hello ^CC0000"+strcharinfo(0)+"^000000!"; next; mes "[Password Event NPC]"; mes "Current Password: ^CC0000"+$event_pword$+"^000000"; mes "Current Prize: ^CC0000"+$event_amount+"^000000 ^CC0000"+getitemname($event_prize)+"^000000"; mes "Number of Winners: ^CC0000"+$event_winners+"^000000"; next; mes "[Password Event NPC]"; mes "How can I help you today?"; menu "Set Password",event_password, "Set Event",event_prize, "Set Winner Count",event_winner, "Start Event",event_start1; event_winner: next; mes "[Password Event NPC]"; mes "How many player do you want to win this event?"; input $event_winners; next; mes "[Password Event NPC]"; mes "Should ^CC0000"+$event_winners+"^000000 win this event?"; menu "Yes",event_count_yes, "Reset",event_winner; event_count_yes: next; mes "[Password Event NPC]"; mes "Then ^CC0000"+$event_winners+"^000000 will win this event!"; close; event_prize: next; mes "[Password Event NPC]"; mes "Please insert the item ID of this event's prize."; input $event_prize; next; mes "[Password Event NPC]"; mes "Now please enter how many ^CC0000"+getitemname($event_prize)+"^000000"; input $event_amount; next; mes "Are you sure you want to give ^CC0000"+$event_amount+"^000000 ^CC0000"+getitemname($event_prize)+"^000000 for this event?"; menu "Yes",event_prize_yes, "Reset",event_prize; event_prize_yes: next; mes "[Password Event NPC]"; mes "Then ^CC0000"+$event_amount+"^000000 ^CC0000"+getitemname($event_prize)+"^000000 it is!"; close; event_start1: next; mes "[Password Event NPC]"; mes "Then let's begin!"; close2; announce "Password Event NPC: The Password Event has begun!",bc_blue; sleep2 5000; announce "Password Event NPC: Try to crack the password to win "+$event_amount+" "+getitemname($event_prize)+"!",bc_blue; sleep2 5000; announce "Password Event NPC: Only "+$event_winners$+" can win this event!",bc_blue; sleep2 5000; announce "Password Event NPC: Now go! Try to crack the password!"; set $event_run,1; end; event_start: while(set(.@a,.@a+1)<=getarraysize(.event_winner)) if ( .event_winner[.@a-1] == getcharid(3) ) { mes "[Password Event NPC]"; mes "Congratulations! You have already won! Try your luck again next event!"; close; } if ( $crack == $event_winners ) { set $event_run,0; set $event_winners,0; mes "[Password Event NPC]"; mes "All prizes are given away!"; next; mes "[Password Event NPC]"; mes "Try your luck again next event!"; close2; sleep2 5000; announce "Password Event NPC: All prizes have already been acquired!",bc_blue; sleep2 5000; announce "Password Event NPC: Better luck next time to those who didn't win!",bc_blue; end; } mes "[Password Event NPC]"; mes "What is the password for today's event?"; input .@event_try$; if ( .@event_try$ == $event_pword$ ) { next; mes "[Password Event NPC]"; mes "Congratulations! You win "+$event_amount+" "+getitemname($event_prize)+" !"; set .event_winner[(set(.i,.i+1)-1)],getcharid(3); set $crack,$crack+1; getitem $event_prize,$event_amount; close2; if ( Sex == 1 ) { announce "Password Event NPC: "+strcharinfo(0)+" wins!! Let's congratulate him!",bc_blue; end; } announce "Password Event NPC: "+strcharinfo(0)+" wins!! Let's congratulate her!",bc_blue; end; } next; mes "[Password Event NPC]"; mes "Sorry, wrong password!"; close; event_password: next; mes "[Password Event NPC]"; mes "What password would you like to set?"; input $event_pword$; next; mes "[Password Event NPC]"; mes "Do you really want to set ^CC0000"+$event_pword$+"^000000 as this event's password?"; menu "Yes",yes_confirm, "Reset",event_password; yes_confirm: next; mes "[Password Event NPC]"; mes "Then ^CC0000"+$event_pword$+"^000000 it is!"; close; } Then you can call deletearray .event_winner[0],128; When you want to start the event over and clear the winners without the trouble of finding if they're online.
  19. It only works for Harmony clients because it keeps mac address. If you want it to work for other clients... change all instances of last_mac to last_ip
  20. - script dualclientkicker2 -1,{ OnPCLoginEvent: set .@len, query_sql("SELECT DISTINCT `account_id` FROM `char` WHERE `account_id` IN "+ "(SELECT `account_id` FROM `login` WHERE `last_mac` = "+ "(SELECT `last_mac` FROM `login` WHERE `account_id`="+getcharid(3)+")) AND `online` <> 0;",.@a); sleep2 1000; if(.@len>.max) atcommand "@kick "+strcharinfo(0); end; OnInit: set .max, 2; //Max Connections. } Use whatever script you want mine worked when I tested it. -.-
  21. 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; }
  22. means? <> is the operator for "not equal", the same as != Hi! i got problems when updating the cp_credits, i wiped out my server, then i try to vote, when i try to convert my votepoints to credits, it doesnt updating. please help. Because update only works if there is something in the database to edit... query_sql "SELECT `account_id` FROM `cp_credits` WHERE `account_id` = "+getcharid(3)+";",.@a; mes "You have a total of "+#VOTEPOINTS+" Vote Points."; mes "Would you like to convert it to credits?"; mes "^ff0000Note:^000000 1 Vote Points = 1 Credits."; next; switch(select("Let me think first.:Yes, let's continue.")) { case 1: mes .npcName$; mes "Come back if you already want to talk to me."; close; case 2: if(#VOTEPOINTS < 1) { mes .npcName$; mes "You don't have enough Vote Points to convert."; close; } else { mes .npcName$; mes "Put your desired amount to be converted."; } input @vote,0,#VOTEPOINTS; if( @vote < #VOTEPOINTS ) { next; mes .npcName$; mes "Not enough Vote Points."; close; } else { next; mes .npcName$; mes "Thank you! and come again."; if(.@a) query_sql "UPDATE `cp_credits` SET `balance` = `balance` + " + @vote + " WHERE `account_id` = " + getcharid(3) + " AND `balance` <> 0;"; else query_sql "INSERT INTO `cp_credits` (account_id, balance) VALUES ("+getcharid(3)+", "+@vote+")"; set #VOTEPOINTS,#VOTEPOINTS-@vote; close; } }
  23. ok ty i already fixed the colors, how i can "edit/add/delete" news, in-game? this is my script: /* 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; }
  24. Thank you for the post... I actually already have a script a lot like this... Even though it says mvpspawner it works for all monsters. You can even add multiple drop lists and save them with rates I think you might find it useful. http://code.google.com/p/ea-addicts/downloads/detail?name=mvpspawner.txt&can=2&q=
×
×
  • Create New...