-
Posts
2044 -
Joined
-
Last visited
-
Days Won
51
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by AnnieRuru
-
my script has if ( playerattached() ) if ( getgmlevel() < .@min_gm_level ) end; which practically runs query_sql (updating the list) ONLY when the gm level condition is met you just reminded me about this topic ... updated script type 1 and ... the script ... prontera,154,178,5 script kjhfksdjf 100,{ mes "Staffs Online Lists : ^FF0000"+ .total_gm +"^000000 Staffs"; mes "^0000FF_________________^000000"; for ( .@i = 0; .@i < .total_gm; .@i++ ) { mes "[ Lv ^63D1F4"+ .level[.@i] +"^000000 ] ^FF0000@ ^0000FF"+ .name$[.@i] +"^000000"; mes "^0000FF_____________________________^000000"; } close; OnInit: OnPCLoginEvent: OnPCLogoutEvent: .@str$ = "60~99"; // set the conditions here if ( playerattached() ) if ( callfunc( "int_range__", .@str$, getgmlevel() ) ) end; .total_gm = query_sql( "select name, group_id from `char` left join login on `char`.account_id = login.account_id where online = 1 and "+ callfunc( "build_int_range_sql", .@str$, "group_id" ), .name$, .level ); end; } function script int_range__ { if ( compare( getarg(0), "," ) ) explode .@range$, getarg(0), ","; else .@range$ = getarg(0); .@size = getarraysize( .@range$ ); while ( .@i < .@size ) { if ( compare( .@range$[.@i], "~" ) ) { explode .@condition$, .@range$[.@i], "~"; if ( getarg(1) >= atoi( .@condition$[0] ) && getarg(1) <= atoi( .@condition$[1] ) ) return 1; } else if ( atoi( .@range$[.@i] ) == getarg(1) ) return 1; .@i++; } return 0; } function script build_int_range_sql { if ( compare( getarg(0), "," ) ) explode .@range$, getarg(0), ","; else .@range$ = getarg(0); .@size = getarraysize( .@range$ ); while ( .@i < .@size ) { if ( compare( .@range$[.@i], "~" ) ) { explode .@condition$, .@range$[.@i], "~"; .@result$ = .@result$ + getarg(1) +" between "+ atoi( .@condition$[0] ) +" and "+ atoi( .@condition$[1] ); } else .@result$ = .@result$ + getarg(1) +" = "+ atoi( .@range$[.@i] ); if ( .@i != .@size -1 ) .@result$ = .@result$ +" or "; .@i++; } return .@result$; } hmm ... I have complicated this topic ....
-
only this one makes sense ...the rest ... have to disagree prontera,154,178,5 script kjhfksdjf 100,{ mes "Staffs Online Lists : ^FF0000"+ .total_gm +"^000000 Staffs"; mes "^0000FF_________________^000000"; for ( .@i = 0; .@i < .total_gm; .@i++ ) { mes "[ Lv ^63D1F4"+ .level[.@i] +"^000000 ] ^FF0000@ ^0000FF"+ .name$[.@i] +"^000000"; mes "^0000FF_____________________________^000000"; } close; OnInit: OnPCLoginEvent: OnPCLogoutEvent: .@min_gm_level = 3; // minimum GM level if ( playerattached() ) if ( getgmlevel() < .@min_gm_level ) end; .total_gm = query_sql( "select name, group_id from `char` left join login on `char`.account_id = login.account_id where online = 1 and group_id >= "+ .@min_gm_level, .name$, .level ); end; } maybe something like this ? yeah yeah ... I'm agreeing this pointEDIT for below :-- .... no words to say about that <.< there are certain experience can only gain from working in live private server ... like making bug-less event script....
-
Issue with this script based on timing.
AnnieRuru replied to ToiletMaster's question in Scripting Support
yeah I already said in that post, my method is more efficient already ... please get a test server and test it before you post ... because without that check, the script doesn't want to rununless you can post up a solution that's better than mine and emistry -
Issue with this script based on timing.
AnnieRuru replied to ToiletMaster's question in Scripting Support
http://www.eathena.ws/board/index.php?s=&showtopic=262582&view=findpost&p=1436182well-placed goto will speed up optimization ... just like in this example ... without a goto in this script, I need to use callfunc, because On<starttime>: and OnInit: having repeated feature inside it looks even uglier with callfunc -
the data might get manipulate by @loadnpc or @reloadscript ... but its kinda a rare bug though ... nvm prontera,154,178,5 script kjhfksdjf 100,{ .@min_gm_level = 3; .@nb = query_sql( "select name, group_id from `char` left join login on `char`.account_id = login.account_id where online = 1 and group_id >= "+ .@min_gm_level, .@name$, .@level ); mes "Staffs Online Lists : ^FF0000"+ .@nb +"^000000 Staffs"; mes "^0000FF_________________^000000"; for ( .@i = 0; .@i < .@nb; .@i++ ) { mes "[ Lv ^63D1F4"+ .@level[.@i] +"^000000 ] ^FF0000@ ^0000FF"+ .@name$[.@i] +"^000000"; mes "^0000FF_____________________________^000000"; } close; } what's getmapxy( .Map$,.x,.y,0,.GM_Name$[.@i] ); doing there actually ?
-
http://www.eathena.ws/board/index.php?showtopic=269783 /* create table log.gm_item_giver ( id int(11) not null auto_increment primary key, `time` datetime, gm_give varchar(23), receiver varchar(23), itemid smallint(11), amount smallint(6) ) engine = archive; */ // ~~~~~ show time left in days, hours, minutes and seconds ~~~~~ function script timeleft__ { if ( ( .@left = getarg(0) ) <= 0 ) return getarg(0); set .@day, .@left / 86400; set .@hour, .@left % 86400 / 3600; set .@min, .@left % 3600 / 60; set .@sec, .@left % 60; if ( .@day ) return .@day +" day "+ .@hour +" hour"; else if ( .@hour ) return .@hour +" hour "+ .@min +" min"; else if ( .@min ) return .@min +" min "+ .@sec +" sec"; else return .@sec +" sec"; } prontera,155,184,4 script dksfjskjf 100,{ set .@eventgmlevel, 60; // event gm level setarray .@itemid, 7227, 7711; // the only item id to give setarray .@maxamount, 5, 20; // maximum amount of item to give. this is give 1000 red pot maximum setarray .@delay, 60, 60; // delay in minute // can give red potion , max 1000, delay 1 minute // can give orange potion, max 100, delay 2 minute if ( getgmlevel() < .@eventgmlevel ) end; mes "input the player name"; next; if ( input(.@name$, 4,23) ) close; else if ( set( .@aid, getcharid(3, .@name$) ) == 0 ) { mes "player not exist or not online"; close; } else if ( .@aid == getcharid(3) ) { mes "that's you ... baka"; close; } mes "select the item to give"; next; set .@size, getarraysize(.@itemid); for ( set .@i, 0; .@i < .@size; set .@i, .@i +1 ) set .@menu$, .@menu$ + getitemname(.@itemid[.@i]) +":"; set .@menu, select(.@menu$) -1; if ( getd( "#gm_give_"+ .@itemid[.@menu] ) + .@delay[.@menu] * 60 > gettimetick(2) ) { mes "you still can't give this prize to players"; mes "time left: "+ callfunc("timeleft__", getd( "#gm_give_"+ .@itemid[.@menu] ) + .@delay[.@menu] * 60 - gettimetick(2) ); close; } mes "input amount to give."; mes "max = "+ .@maxamount[.@menu]; next; if ( input(.@amount, 1, .@maxamount[.@menu]) ) close; set .@name$, rid2name(.@aid); mes "are you sure want to give"; mes .@name$ +" "+ .@amount +" "+ getitemname(.@itemid[.@menu]) +" ?"; next; if ( select ("Yes:No") == 2 ) close; else if ( isloggedin(.@aid) == 0 ) { mes "player suddenly log off"; close; } .@origin = getcharid(3); attachrid .@aid; if ( !checkweight( .@itemid[.@menu], .@amount ) ) { attachrid .@origin; mes "player is currently overweight"; close; } getitem .@itemid[.@menu], .@amount; attachrid .@origin; announce strcharinfo(0) +" give "+ .@name$ +" "+ .@amount +" "+ getitemname(.@itemid[.@menu]), 0; setd "#gm_give_"+ .@itemid[.@menu], gettimetick(2); query_logsql "insert into gm_item_giver values ( null, now(), '"+ escape_sql( strcharinfo(0) ) +"', '"+ escape_sql(.@name$) +"', "+ .@itemid[.@menu] +", "+ .@amount +")"; close; } EDIT: update timeleft__ function -- offtopic -- LMAO !!! I forgotten I said that XD
-
1. what is THQ shop ? you speak like expecting us can read your mind2. castle drops ... so you mean a shop that sells all castle drop items from castle treasure chest ?
-
if ( strcharinfo(2) == "Legion" ) ....
-
- script ksdfskjfhs -1,{ OnPCLoginEvent: dispbottom "Your timer starts now. You Will receive 1 kafra points after being online for 1 hour"; while (1) { if ( checkvending() ) { set @hourpointafk, @hourpointafk +1 ; if ( @hourpointafk >= .afk && @hourpointafk % .afk == 0 ) { dispbottom "you have vending for "+( ( .sleeploop/1000 * @hourpointafk ) /60 )+" minutes"; set @hourpointtick, 0; } } else { set @hourpointafk, 0; set @hourpointtick, @hourpointtick +1 ; if ( @hourpointtick > .tick ) { #KAFRAPOINTS = #KAFRAPOINTS +1; dispbottom "You have received 1 kafra point"; set @hourpointtick, 0; } } sleep2 .sleeploop; } end; // doesn't read OnInit: set .sleeploop, 30000; // every 30 seconds set .tick, 120; // loop 120 times of 30 seconds == 1 hour set .afk, 10; // loop 10 times of 30 seconds = 5 minutes end; } so many hourly point giver out there .....
-
ohh ... event script ... <3 somehow I already sense need some source modification already dunno what kind of quest you are talking about, but seems like need certain types of variables ? I already did dota announcement script ... no problem somehow I feel like want to start this script with battleground ... but this one makes me rethink again ... ?because under battleground system, teammates can't kill each others sounds like a counter-strike ?
-
prontera,154,181,5 script kdjsfhksfjh 100,{ end; OnInit: setarray .@disp_waitingroom0$, "1", "pvp_n_2-3", "100"; // 2 dimension array setarray .@disp_waitingroom1$, "2", "guild_vs2", "50"; while (1) { waitingroom "Room #"+ getd( ".@disp_waitingroom"+ .@i +"$[0]" ) +" ["+ getmapusers( getd( ".@disp_waitingroom"+ .@i +"$[1]" ) ) +"/"+ getd( ".@disp_waitingroom"+ .@i +"$[2]" ) +"]", 0; sleep 5000; .@i++; if ( .@i == 2 ) .@i = 0; delwaitingroom; } end; // doesn't read }
-
Shop that item used instead of zeny?
AnnieRuru replied to Blazing Spear's question in Script Requests
feels like want to update this script prontera,156,172,5 script market 100,{ dispbottom "You currently have "+ countitem(.itemuse) +" "+ getitemname(.itemuse); callshop "market2#hidden", 1; end; OnBuyItem: if ( !@bought_quantity ) end; .@size = getarraysize( @bought_nameid ); while ( .@i < .@size ) { .@j = 0; while ( @bought_nameid[.@i] != .itemid[.@j] && .@j < .shop_size ) .@j++; .@itemcost = .@itemcost + .itemcost[.@j] * @bought_quantity[.@i]; .@i++; } if ( .@itemcost > countitem(.itemuse) ) { mes "you don't have enough "+ getitemname(.itemuse); close; } delitem .itemuse, .@itemcost; for ( set .@i,0; .@i < .@size; set .@i, .@i +1 ) getitem @bought_nameid[.@i], @bought_quantity[.@i]; deletearray @bought_nameid; deletearray @bought_quantity; end; OnInit: setarray .itemid,512,513,514,515,516; setarray .itemcost,10,20,30,40,50; set .itemuse, 674; .shop_size = getarraysize(.itemid); npcshopdelitem "market2#hidden", 512; for ( .@i = 0; .@i < .shop_size; .@i++ ) npcshopadditem "market2#hidden", .itemid[.@i], .itemcost[.@i]; npcshopattach "market2#hidden"; end; } - shop market2#hidden -1,512:10000 -
OnPCStatCalcEvent_17007.patch /* bStr 13 bAgi 14 bVit 15 bInt 16 bDex 17 bLuk 18 */ prontera,154,181,5 script kjfhsdkfjh 100,{ // enable_items; stat_recalc(); bonus_stat = 0; mes "which bonus do you want ?"; next; .@s = select ( "str +5", "agi +5", "vit +5", "int +5", "dex +5", "luk +5" ) -1; if ( bonus_stat & 1 << .@s ) { mes "you already gain this bonus"; close; } bonus_stat = bonus_stat | 1 << .@s; stat_recalc(); close; OnPCStatCalcEvent: // for ( .@i = 0; .@i < 6; .@i++ ) // if ( bonus_stat & 1 << .@i ) // bonus .@i + 13, 5; bonus bstr, 5; dispbottom "test run"; end; } prontera,154,183,5 script kjdfhksdjf 100,{ stat_recalc(); } again this script is not working ... previously OnPCStatCalcEvent can works on change maps and permanent bonus but if use a script command to reforce status recalculation ... stat_recalc() script command isn't working ... can't figure out why maybe just use *nude ... prontera,154,181,5 script kjfhsdkfjh 100,{ mes "which bonus do you want ?"; next; .@s = select ( "str +5", "agi +5", "vit +5", "int +5", "dex +5", "luk +5" ) -1; if ( bonus_stat & 1 << .@s ) { mes "you already gain this bonus"; close; } bonus_stat = bonus_stat | 1 << .@s; nude; close; OnPCStatCalcEvent: for ( .@i = 0; .@i < 6; .@i++ ) if ( bonus_stat & 1 << .@i ) bonus .@i + 13, 5; end; } and force user to put on their equipments to recalculate the bonus ... EDIT: for those who new to this OnPCStatCalcEvent: 2nd script works, but 1st script here doesn't work
-
for me ... just once XD http://www.eathena.ws/board/index.php?s=&showtopic=165050&view=findpost&p=910278 and yeah ... this command is useless because the updated script for it looks like this ... http://www.eathena.ws/board/index.php?s=&showtopic=239535&view=findpost&p=1307075 so yeah, vote +1 to remove it ... better not,or a better solution is use addrid script command ... but somehow it also looks custom ... better don't do something about adding this feature yet until a very confirm solution has found by community
-
change this line debugmes "Quest requirement #"+getarg(.@n)+" invalid (skipped)."; return; } } into this debugmes "Quest requirement #"+getarg(.@n)+" invalid (skipped) on Quest ItemID "+ getarg(1) +"."; return; } }
-
more tricks XD prontera,156,184,4 script ksdjfhskhfj 100,{ mes "blah"; .@job = getd( ".job"+ basejob ); // note : if basejob is out of range, will default to novice because its 0 .@s = select( .menu$[ .@job ] ) -1; close2; // callshop "weapon_shop#"+ getd( ".weaponselect"+ getd( ".job"+ basejob ) +"["+ .@s +"]" ), 1; // PS: ... seen this in my mission board script ? XD callshop "weapon_shop#"+ getd( ".weaponselect"+ .@job +"["+ .@s +"]" ), 1; // EDITED : optimized a little bit end; OnInit: setd ".job"+ Job_Novice, 0; setd ".job"+ Job_SuperNovice, 0; setd ".job"+ Job_Swordman, 1; setd ".job"+ Job_Mage, 2; setd ".job"+ Job_Archer, 3; setd ".job"+ Job_Acolyte, 4; setd ".job"+ Job_Merchant, 5; setd ".job"+ Job_Thief, 6; setd ".job"+ Job_Knight, 7; setd ".job"+ Job_Priest, 8; setd ".job"+ Job_Wizard, 9; setd ".job"+ Job_Blacksmith, 10; setd ".job"+ Job_Hunter, 11; setd ".job"+ Job_Assassin, 12; setd ".job"+ Job_Crusader, 14; setd ".job"+ Job_Monk, 15; setd ".job"+ Job_Sage, 16; setd ".job"+ Job_Rogue, 17; setd ".job"+ Job_Alchemist, 18; setd ".job"+ Job_Bard, 19; setd ".job"+ Job_Dancer, 19; setd ".job"+ Job_Taekwon, 21; setd ".job"+ Job_Star_Gladiator, 22; setd ".job"+ Job_Soul_Linker, 23; setd ".job"+ Job_Gunslinger, 24; setd ".job"+ Job_Ninja, 25; setarray .@weaponname$[1], "Daggers", "One-handed swords", "Two-handed swords", "One-handed spears", "Two-handed spears", "One-handed axes", "Two-handed axes", "Maces", "", // <-- stupid unused "Staves", "Bows", "Knuckles", "Musical Instruments", "Whips", "Books", "Katars", "Revolvers", "Rifles", "Gatling guns", "Shotguns", "Grenade launchers", "Fuuma Shurikens", "Two-handed staves"; // select hex( sum(aaa) ) from ( select 1 << view as aaa from item_db where type = 4 && equip_jobs & 1<<0 group by view ) as zzz; setarray .@weaponbits, 0x54E, // 0 novice 0x1FE, // 1 swordsman 0x80050A, // 2 mage 0x90A, // 3 archer 0x80050A, // 4 acolyte 0x1CE, // 5 merchant 0x94E, // 6 thief 0x1FE, // 7 knight 0x80950A, // 8 priest 0x80050A, // 9 wizard 0x1CE, // 10 blacksmith 0x90A, // 11 hunter 0x1014E, // 12 assassin -1, // 13 unused 0x1FE, // 14 crusader 0x80150A, // 15 monk 0x80850A, // 16 sage 0x94E, // 17 rogue 0x1CE, // 18 alchemist 0x690A, // 19 barddancer -1, // 20 unused 0x10A, // 21 taekwon 0x810A, // 22 star gladiator 0x80050A, // 23 soul linker 0x3E010A, // 24 gunslinger 0x40010A; // 25 ninja freeloop 1; .@i = 0; while ( .@i <= 25 ) { // job index if ( .@i != 13 && .@i != 20 ) { // unused .@j = 1; .@c1 = .@c2 = 0; while ( .@j <= 22 ) { // weapon index if ( .@j != 9 ) { if ( .@weaponbits[.@i] & 1 << .@j ) { .menu$[.@i] = .menu$[.@i] +"^00CC00"+ .@weaponname$[.@j] +":"; setd ".weaponselect"+ .@i +"["+ .@c1 +"]", .@j; .@c1++; } else { .@menu$[.@i] = .@menu$[.@i] +"^FF0000"+ .@weaponname$[.@j] +":"; setd ".@weaponselect"+ .@i +"["+ .@c2 +"]", .@j; .@c2++; } } .@j++; } .menu$[.@i] = .menu$[.@i] + .@menu$[.@i]; copyarray getd( ".weaponselect"+ .@i +"["+ .@c1 +"]" ), getd( ".@weaponselect"+ .@i ), .@c2; } .@i++; } .@i = 1; while ( .@i <= 22 ){ // weapon shops .@nb = query_sql( "select id from item_db where type = 4 && view = "+ .@i +" limit 128", .@id ); npcshopdelitem "weapon_shop#"+ .@i, 501; .@j = 0; while ( .@j < .@nb ) { npcshopadditem "weapon_shop#"+ .@i, .@id[.@j], getiteminfo( .@id[.@j], 0 ); .@j++; } .@i++; } freeloop 0; end; } - shop weapon_shop#1 -1,501:1000 - shop weapon_shop#2 -1,501:1000 - shop weapon_shop#3 -1,501:1000 - shop weapon_shop#4 -1,501:1000 - shop weapon_shop#5 -1,501:1000 - shop weapon_shop#6 -1,501:1000 - shop weapon_shop#7 -1,501:1000 - shop weapon_shop#8 -1,501:1000 - shop weapon_shop#10 -1,501:1000 - shop weapon_shop#11 -1,501:1000 - shop weapon_shop#12 -1,501:1000 - shop weapon_shop#13 -1,501:1000 - shop weapon_shop#14 -1,501:1000 - shop weapon_shop#15 -1,501:1000 - shop weapon_shop#16 -1,501:1000 - shop weapon_shop#17 -1,501:1000 - shop weapon_shop#18 -1,501:1000 - shop weapon_shop#19 -1,501:1000 - shop weapon_shop#20 -1,501:1000 - shop weapon_shop#21 -1,501:1000 - shop weapon_shop#22 -1,501:1000 1. after browse through euphy and emistry script ... only I realize I forgot to make available weapon selection to top of the menu as green ... so I split them out into 2 dimension array ... then crunch them with copyarray 2. hint: ... I completely rewrite from yours because my script is based on doc\item_db.txt documentation 3. yeah I also same as @ToastOfDoom prefer to move calculations to server startup so when accessing this script, the server will do as few calculations as possible EDITED: @keyworld yeah I also realized that later on ... though before you post that though for 2 days my internet connection is unstable ... now ok a bit ... but still slow sometimes EDIT on 19/April/2018 http://upaste.me/1879496403dd64bde might as well update this a little bit, though I don't think its good idea to bump such old topic since the topic starter has already inactive
-
... I also start to feel script request section becoming more interesting than script release section ... anyways poll_0.2.txt dunno why but I feel myzter's one is even better than this one ... just ... 1. if you want to add reply options for players, I can rip from [GM]Xeon's script and add in this one PS : sometimes you want to hear some comments from player side 2. current script limit the voting by account_id ... if u want to limit by ip address also can do it ... not sure anything else ... but I can pretty much add in anything
-
Anyone want to make Roulette script?
AnnieRuru replied to Peopleperson49's question in Script Requests
first of all, there's no such things as a challenge ... lol a script showdown is just something to learn each other scripter's technique and so there's no winner, or a best script a best script is actually differ from each individual ... for example, sometimes I made a script too overly complicated ... and I failed in explanations how to let user edit my script... ( sometimes .. people don't want my overly complicated solutions and prefer to pick emistry's solution because his script has more readability ) and sometimes, I even asked back the user that I want to add extra features for it ... while it looks cool to me, but the user doesn't want them ... etc script request section is indeed a place to request for a script and WE the scripters take that questions as a challenge to our scripting ability but the special things about script request section is :- when more than 1 scripters provides a solution -> it also means there's more than 1 solutions to that question, that is the time when we learn each other individual's techniques which makes scripting request section a very fun place to browse however ... I won't allow thisI want to join in this fun, but I want to remind there's no competition to this I might post up my solutions, emistry might wants to try this too ( he seems to be very interested ) but there's no best script this topic is a valid one ... but I will not allow voting session .. just take this topic easy ... everyone are welcome to try ... everyone are welcome to help criticize ... seems there's 3 person wants to pick this up ... me, emistry and peopleperson49 when we have posted up our solutions, we'll welcome anyone and criticize our script to help us improve our scripting technique and maybe, after compare out each one of our scripts we might even combine our scripts into 1 ? <--- this is where the fun starts XD EDIT: after we all post our scripts, we'll start to rip each other techniques and learn from each others XD -
/* create table itemperIP ( last_ip varchar(20) primary key ) engine = innodb; */ prontera,155,180,5 script asdf 100,{ query_sql "select last_ip from login where account_id = "+ getcharid(3), .@ip$; if ( query_sql( "select 1 from itemperip where last_ip = '"+ .@ip$ +"'", .@dummy ) ) dispbottom "you already claimed the reward"; else { query_sql "insert into itemperip values ( '"+ .@ip$ +"' )"; dispbottom "here is your item"; getitem 501,1; } end; OnClock0000: OnClock0600: OnClock1200: OnClock1800: query_sql "truncate itemperip"; end; }
-
Issue with this script based on timing.
AnnieRuru replied to ToiletMaster's question in Scripting Support
hmm ... just tested your script doesn't run more like this prontera,157,178,5 script Clemy 703,{ end; OnMon0000: OnWed0000: .unhide = 0; disablenpc strnpcinfo(0); end; OnSun0000: OnTue0000: enablenpc strnpcinfo(0); .unhide = 1; goto L_start; OnInit: if ( gettime(4) != 0 && gettime(4) != 2 ) { // add this... disablenpc strnpcinfo(0); end; } else .unhide = 1; L_start: .@interval = 2; .@step = 5; while ( .unhide ) { sleep .@interval * 1000; getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; npctalk callfunc( "F_RandMes", 2, "Heloo!!!", // 1 "Goodbye~!" // 2 ); } end; } suddenly feels my method without disablenpc in while-loop is more efficient ... dunno... well as long it works ... -
how to reproduce this error ? o.o my test server runs fine with this script using rathena ?
-
Issue with this script based on timing.
AnnieRuru replied to ToiletMaster's question in Scripting Support
@emistry hmm ... can also but before the end of npc, need to add disablenpc strnpcinfo(0); though -
wow ... scary !! its been sometime I get this 'defeated' feeling the last time I got this feeling is when having script showdown with keyworld last year.... I think Emistry script is the one closest to Vach scripting level
-
I've tried out several methodsseems like 'enormous switch in the beginning' is unavoidable prontera,156,184,4 script ksdjfhskhfj 100,{ mes "blah"; switch ( basejob ) { case Job_Novice: case Job_SuperNovice: .@job = 0; break; case Job_Swordman: .@job = 1; break; case Job_Mage: .@job = 2; break; case Job_Archer: .@job = 3; break; case Job_Acolyte: .@job = 4; break; case Job_Merchant: .@job = 5; break; case Job_Thief: .@job = 6; break; case Job_Knight: .@job = 7; break; case Job_Priest: .@job = 8; break; case Job_Wizard: .@job = 9; break; case Job_Blacksmith: .@job = 10; break; case Job_Hunter: .@job = 11; break; case Job_Assassin: .@job = 12; break; case Job_Crusader: .@job = 14; break; case Job_Monk: .@job = 15; break; case Job_Sage: .@job = 16; break; case Job_Rogue: .@job = 17; break; case Job_Alchemist: .@job = 18; break; case Job_Bard: case Job_Dancer: .@job = 19; break; case Job_Taekwon: .@job = 21; break; case Job_Star_Gladiator: .@job = 22; break; case Job_Soul_Linker: .@job = 23; break; case Job_Gunslinger: .@job = 24; break; case Job_Ninja: .@job = 25; break; default: mes "error"; close; } .@s = select( .menu$[ .@job ] ); close2; callshop "weapon_shop#"+ .@s, 1; end; OnInit: setarray .weaponname$[1], "Daggers", "One-handed swords", "Two-handed swords", "One-handed spears", "Two-handed spears", "One-handed axes", "Two-handed axes", "Maces", "", // <-- stupid unused "Staves", "Bows", "Knuckles", "Musical Instruments", "Whips", "Books", "Katars", "Revolvers", "Rifles", "Gatling guns", "Shotguns", "Grenade launchers", "Fuuma Shurikens", "Two-handed staves"; // select hex( sum(aaa) ) from ( select 1 << view as aaa from item_db where type = 4 && equip_jobs & 1<<0 group by view ) as zzz; setarray .@weaponbits, 0x54E, // 0 novice 0x1FE, // 1 swordsman 0x80050A, // 2 mage 0x90A, // 3 archer 0x80050A, // 4 acolyte 0x1CE, // 5 merchant 0x94E, // 6 thief 0x1FE, // 7 knight 0x80950A, // 8 priest 0x80050A, // 9 wizard 0x1CE, // 10 blacksmith 0x90A, // 11 hunter 0x1014E, // 12 assassin -1, // 13 unused 0x1FE, // 14 crusader 0x80150A, // 15 monk 0x80850A, // 16 sage 0x94E, // 17 rogue 0x1CE, // 18 alchemist 0x690A, // 19 barddancer -1, // 20 unused 0x10A, // 21 taekwon 0x810A, // 22 star gladiator 0x80050A, // 23 soul linker 0x3E010A, // 24 gunslinger 0x40010A; // 25 ninja freeloop 1; for ( .@j = 0; .@j <= 25; .@j++ ) { // job index if ( .@j == 13 || .@j == 20 ) continue; for ( .@i = 1; .@i <= 22; .@i++ ) { // weapon index if ( .@i != 9 ) .menu$[.@j] = .menu$[.@j] +( ( .@weaponbits[.@j] & 1 << .@i )? "^00FF00" : "^FF0000" )+ .weaponname$[.@i] +":"; else .menu$[.@j] = .menu$[.@j] +":"; } } .@i = 1; while ( .@i <= 23 ){ .@nb = query_sql( "select id from item_db where type = 4 && view = "+ .@i, .@id ); npcshopdelitem "weapon_shop#"+ .@i, 501; .@j = 0; while ( .@j < .@nb ) { npcshopadditem "weapon_shop#"+ .@i, .@id[.@j], getiteminfo( .@id[.@j], 0 ); .@j++; } .@i++; } freeloop 0; end; } - shop weapon_shop#1 -1,501:1000 - shop weapon_shop#2 -1,501:1000 - shop weapon_shop#3 -1,501:1000 - shop weapon_shop#4 -1,501:1000 - shop weapon_shop#5 -1,501:1000 - shop weapon_shop#6 -1,501:1000 - shop weapon_shop#7 -1,501:1000 - shop weapon_shop#8 -1,501:1000 - shop weapon_shop#10 -1,501:1000 - shop weapon_shop#11 -1,501:1000 - shop weapon_shop#12 -1,501:1000 - shop weapon_shop#13 -1,501:1000 - shop weapon_shop#14 -1,501:1000 - shop weapon_shop#15 -1,501:1000 - shop weapon_shop#16 -1,501:1000 - shop weapon_shop#17 -1,501:1000 - shop weapon_shop#18 -1,501:1000 - shop weapon_shop#19 -1,501:1000 - shop weapon_shop#20 -1,501:1000 - shop weapon_shop#21 -1,501:1000 - shop weapon_shop#22 -1,501:1000 - shop weapon_shop#23 -1,501:1000 btw I don't hold back in my scripting technique ... so take your time to crack this EDIT: wtf ???? post at same time EDIT2: editing script .... done I think the main difference is Euphy script calculate it when the script call for it while mine has already did itself when server startup EDIT3: from below wow thx for reminding ! EDIT4: fix a bug on .@s = select( .menu$ ); ... missing index
-
Made by @Myzter http://www.eathena.w...howtopic=165462 made by [GM]Xeon, and fixed by me http://www.eathena.w...dpost&p=1057684 supportticket.txt try both of them and say ... which one is closest to your feel I might possibly create a new one from scratch and your post ... too little information ... I don't even know 'what is the kind of poll system' you want forum style ... or just voting on questions ... etc btw, is there any poll script in rathena forum ?