Jump to content

Capuche

Developer
  • Posts

    2407
  • Joined

  • Last visited

  • Days Won

    52

Everything posted by Capuche

  1. You should ask in source support
  2. Capuche

    Gamble NPC

    prontera,150,182,5 script vbgnhjkl 56,{ mes "gamble ?"; next; if( select( "Yes", "No" ) -1 ) close; else if( Zeny < .cost ) { mes "you need "+ .cost +" Zeny"; close; } do { .@r = rand( .min_hat_id, .max_hat_id ); for( .@i = 0; .@i < .size_type; .@i++ ) { .@c = ( .item_Type[.@i] != 5 ? getiteminfo( .@r,2 ) == .item_Type[.@i] : ( getiteminfo( .@r,5 )&.hat_equip ) != 0 ); if( .@c && !compare( .black_list$, .@r +"" ) ) { .@fullfit++; break; } else if( .@count == 100 ) { mes "I don't find any item !"; close; } else .@count++; } } while( !.@fullfit ); mes "here a "+ getitemname( .@r ) +" (ID: "+ .@r +")"; getitem .@r, 1; Zeny -= .cost; close; OnInit: .cost = 1000000; // Zeny gamble .max_hat_id = 5859; .min_hat_id = 5001; .hat_equip = 1|256|512; // low + middle + head type hat - .item_Type must contain type 5 setarray .item_Type, 0, 2, 4; .size_type = getarraysize( .item_Type ); set .black_list$, "5005|5006|5007"; // black list ID end; } // Type: // 0 Healing item. // 2 Usable item. // 3 Etc item // 4 Weapon // 5 Armor/Garment/Boots/Headgear // 6 Card // 7 Pet egg // 8 Pet equipment // 10 Ammo (Arrows/Bullets/etc) // 11 Usable with delayed consumption (item is lost from inventory // after selecting a target, for use with skills and pet lures) // 18 Another delayed consume that requires user confirmation before // using item. Set your setting here OnInit: .cost = 1000000; // Zeny gamble .max_hat_id = 5859; .min_hat_id = 5001; .hat_equip = 1|256|512; // low + middle + head type hat - .item_Type must contain type 5 setarray .item_Type, 0, 2, 4; .size_type = getarraysize( .item_Type ); set .black_list$, "5005|5006|5007"; // black list ID end; with the Type of item you want to give (etc, usable item...) setarray .item_Type, 0, 2, 4; following And think about the range of item ID .max_hat_id = 5859; .min_hat_id = 5001; If you want an item Type usable but there aren't usable item in the range of item ID, the npc tell you it doesn't find any item. Resumed: the main setting are .max_hat_id = 5859; .min_hat_id = 5001; setarray .item_Type, 0, 2, 4;
  3. Try this one - script spawn_woe -1,{ OnAgitStart:// when woe start sleep 2; for( .@i = 0; .@i < .size_mob; .@i++ ) { for( .@j = 0; .@j < .size_map; .@j++ ) monster .map_woe$[.@j],0,0,"--ja--", .mob_ID[.@i], .mob_count[.@i],""; } end; OnAgitEnd:// when woe end sleep 2; for( .@i = 0; .@i < .size_map; .@i++ ) { sleep2 1; killmonsterall .map_woe$[.@i]; } end; OnNPCKillEvent: sleep2 1; if( agitcheck() && compare( .mob_id_c$, killedrid +"" ) && compare( .map_woe_c$, strcharinfo(3) ) )// check is woe on + if mob in .mob_ID list + map in .map_woe$ list monster strcharinfo(3),0,0,"--ja--", killedrid,1,""; end; OnInit: // ------- setting setarray .mob_ID, 1638, 1639; // add more mob id setarray .mob_count, 40, 40;// number of mobs summoned / .mob_ID array column setarray .map_woe$, "aldeg_cas01", "aldeg_cas02"; // yours woe map //-------- end of setting .size_mob = getarraysize( .mob_ID ); .size_map = getarraysize( .map_woe$ ); for( .@i = 0; .@i < .size_mob; .@i++ ) .@tmp$[.@i] = .mob_ID[.@i]; .mob_id_c$ = implode( .@tmp$, "|" ); .map_woe_c$ = implode( .map_woe$, "|" ); end; } and add in npc/guild/agit_main.txt donpcevent "spawn_woe::OnAgitStart"; after announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by the [" + getguildName(.@GID) + "] guild.",bc_all|bc_woe;
  4. Then it's SC_CONCENTRATE not SC_CONCENTRATION sc_start SC_CONCENTRATE,240000,10;
  5. Maybe this ? http://lmgtfy.com/?q=Reaction+Event+eathena First link First post
  6. You can rent any item with rentitem script command Sample prontera,150,180,5 script rent godly 56,{ mes "rent an godly item ?"; next; if( select( "Rent", "leave" ) -1 ) close; rentitem 2629, 86400; mes "done"; close; } Make it according your imagination
  7. I don't get this part. The script is like a spawn permanent, you kill one monster, this one is spawn randomly in the castle. Spawn again... maybe you don't want a permanent spawn and the monsters are all re-spawn 2 min after the emp is broken ? Read the doc/script_commands.txt I read the whole file + some npc script.. the docs are the basis
  8. prontera,148,188,5 script Breaker Ladder 790,{ query_sql "SELECT `char`.char_id,`char`.`name`,global_reg_value.`value` "+ "FROM global_reg_value LEFT JOIN `char` ON global_reg_value.char_id=`char`.char_id WHERE global_reg_value.str='brokeemp' "+ "ORDER BY CAST(`global_reg_value`.`value` AS UNSIGNED) DESC LIMIT 10", .@char_id, .@name$, .@count; mes "[ ^00FF00 Kaspersky ^000000 ]"; mes "Hello there "+strcharinfo(0)+", what do you want to do?"; menu "Check Emperium Break Points",-,"View Breaker Ladder",Llad,"Exchange Points",Lex, ( getgmlevel() > 98 ? "Reset Breaker" : "" ), L_reset, "Nothing",Lno; next; mes "[ ^00FF00 Kaspersky ^000000 ]"; mes "Hmm, wait a second, i'll go check my records.."; next; mes strcharinfo(0)+"'s Emperium Break Points is ^FF0000"+brokeemp+"^000000 Point(s)"; close; L_reset: next; mes "you really want to reset the breaker ?"; next; if ( select( "yes","no" ) -1 ) close; query_sql "DELETE FROM global_reg_value WHERE global_reg_value.`str` = 'brokeemp'"; mes "it's done ! you must log out/log in to see the change"; close; Lno: next; mes "[ ^00FF00 Kaspersky ^000000 ]"; mes "Suit yourself.."; close; Lex: next; mes "[ ^00FF00 Kaspersky ^000000 ]"; mes "What points would you like to exchange?"; mes "^FF0000Note: Check your inventory and weight before exchanging with me!"; menu "Emperium Break Points",-,"Nothing",Lno; next; mes "[ ^00FF00 Kaspersky ^000000 ]"; mes "What do you want to exchange with?"; menu "Billow",-,"Emblem of Solar God",Lesg,"Ripple",Lrip,"Silver Ornament",Lsil,"Wrath of Valkyrie",Lval; next; mes "[ ^00FF00 Kaspersky ^000000 ]"; mes "You need 75 Breaker Points for this.."; mes "Do you still want Billow?"; menu "Yes",-,"No",Lno; if(brokeemp < 75) goto Lnep; if(brokeemp >= 75) next; mes "Here you go!"; getitem 7091,1; set brokeemp,brokeemp-75; close; Lnep: next; mes "[ ^00FF00 Kaspersky ^000000 ]"; mes "Not enough points!"; close; Lesg: next; mes "[ ^00FF00 Kaspersky ^000000 ]"; mes "You need 75 Breaker Points for this.."; mes "Do you still want Emblem of Solar God?"; menu "Yes",-,"No",Lno; next; if(brokeemp < 75) goto Lnep; if(brokeemp >= 75) mes "[ ^00FF00 Kaspersky ^000000 ]"; mes "Here you go!"; getitem 7086,1; set brokeemp,brokeemp-75; close; Lrip: mes "[ ^00FF00 Kaspersky ^000000 ]"; mes "You need 75 Breaker Points for this.."; mes "Do you still want Ripple?"; menu "Yes",-,"No",Lno; if(brokeemp < 75) goto Lnep; if(brokeemp >= 75) next; mes "Here you go!"; getitem 7090,1; set brokeemp,brokeemp-75; close; Lval: mes "[ ^00FF00 Kaspersky ^000000 ]"; mes "You need 75 Breaker Points for this.."; mes "Do you still want Wrath of Valkyrie?"; menu "Yes",-,"No",Lno; if(brokeemp < 75) goto Lnep; if(brokeemp >= 75) next; mes "Here you go!"; getitem 7078,1; set brokeemp,brokeemp-75; close; Lsil: mes "[ ^00FF00 Kaspersky ^000000 ]"; mes "You need 75 Breaker Points for this.."; mes "Do you still want Silver Ornament?"; menu "Yes",-,"No",Lno; if(brokeemp < 75) goto Lnep; if(brokeemp >= 75) next; mes "Here you go!"; getitem 7077,1; set brokeemp,brokeemp-75; close; Llad: next; for( set .@x,0; .@x<=9; set .@x,.@x+1 ) mes "^0000FF"+(.@x+1)+".^000000 "+.@name$[.@x]+" - ^FF0000"+.@count[.@x]+"^000000 Point(s)"; // .@x starts at 0, but you want to start with '1st', so use (.@x+1) close; }
  9. Like that ? - script spawn_woe -1,{ OnInit: setarray .mob_ID, 1001, 1002, 1003, 1005; // add more mob id setarray .map_event$, "prontera", "geffen"; // yours woe map .size_mob = getarraysize( .mob_ID ); .size_map = getarraysize( .map_event$ ); end; OnMinute00: OnMinute30: .@r = rand( .size_mob ); .@m = rand( .size_map ); monster .map_event$[.@m],0,0,"--ja--", .mob_ID[.@r],1,""; announce "a "+ strmobinfo( 1,.mob_ID[.@r] ) +" is spawn in "+ .map_event$[.@m] +" !",0; end; }
  10. No when you kill a monster, you spawn 4 or 6 monsters in each map this way. Try this - script spawn_woe -1,{ OnAgitStart:// when woe start sleep 2; for( .@i = 0; .@i < .size_mob; .@i++ ) { for( .@j = 0; .@j < .size_map; .@j++ ) monster .map_woe$[.@j],0,0,"--ja--", .mob_ID[.@i], .mob_count[.@i],""; } end; OnAgitEnd:// when woe end sleep 2; for( .@i = 0; .@i < .size_map; .@i++ ) killmonsterall .map_woe$[.@i]; end; OnNPCKillEvent: if( agitcheck() && compare( .mob_id_c$, killedrid +"" ) && compare( .map_woe_c$, strcharinfo(3) ) )// check is woe on + if mob in .mob_ID list + map in .map_woe$ list monster strcharinfo(3),0,0,"--ja--", killedrid,1,""; end; OnInit: // ------- setting setarray .mob_ID, 1638, 1639; // add more mob id setarray .mob_count, 40, 40;// number of mobs summoned / .mob_ID array column setarray .map_woe$, "aldeg_cas01", "aldeg_cas02"; // yours woe map //-------- end of setting .size_mob = getarraysize( .mob_ID ); .size_map = getarraysize( .map_woe$ ); for( .@i = 0; .@i < .size_mob; .@i++ ) .@tmp$[.@i] = .mob_ID[.@i]; .mob_id_c$ = implode( .@tmp$, "|" ); .map_woe_c$ = implode( .map_woe$, "|" ); end; }
  11. It's working on my local. There isn't stat icon for SC_CONCENTRATION (= concentration skill of LK class)
  12. - script spawn_woe -1,{ OnAgitStart:// when woe start for( .@i = 0; .@i < .size_mob; .@i++ ) monster "aldeg_cas01",0,0,"--ja--", .mob_ID[.@i],4,strnpcinfo(0) +"::OnKillMob"+ .@i; end; OnAgitEnd:// when woe end sleep 2; killmonsterall "aldeg_cas01"; end; OnKillMob0: if( agitcheck() ) {// check is woe on .@i = 0; // for OnKillMob0 event monster "aldeg_cas01",0,0,"--ja--", .mob_ID[.@i],1,strnpcinfo(0) +"::OnKillMob"+ .@i;// spawn 1 mob } end; OnKillMob1: if( agitcheck() ) { .@i = 1; monster "aldeg_cas01",0,0,"--ja--", .mob_ID[.@i],1,strnpcinfo(0) +"::OnKillMob"+ .@i; } end; OnInit: setarray .mob_ID, 1638, 1639; // add more mob id .size_mob = getarraysize( .mob_ID ); end; } It's an example with 2 mobs ID. If you add more mob ID, you must add more OnKillMobX event label. It's not the only way, you can use OnNPCKillEvent label too.
  13. No search in atcommand.c ACMD_FUNC(refresh) and replace the current function by TrojanWorm's function You also can block @refresh on pvp map with npc script - script refresh_pvp -1,{ OnInit: bindatcmd "refresh",strnpcinfo(0) +"::OnRefresh"; end; OnRefresh: if( getmapflag( strcharinfo(3),mf_pvp ) ) message strcharinfo(0),"@refresh is not allowed in pvp map."; end; }
  14. Haha it was for testing purpose
  15. Little optimized map,146,139,5 script Arena Master 808,{ if( select("PVP Room [ "+getmapusers("arena02")+"/50 ]:Cancel") == 1 ) { if( getmapusers("arena02") >= 50 ) { mes "[Arena Master]", "I'm sorry but the PVP Room is already full!"; close; } addtimer 300000,"Arena Master::OnTimeout"; warp "arena02",0,0; percentheal 100,100; } close; OnPCDieEvent: getmapxy .@map$, .@x, .@y, 0; if( .@map$ != "arena02" ) end; sleep2 2; warp .@map$, .@x, .@y; percentheal 100,100; end; OnTimeout: dispbottom "5 minutes has been elapsed."; warp "SavePoint",0,0; end; }
  16. Little optimized lunar01,219,180,4 script Dreamworks Coins 807,5,5,{ OnTouch: if ( @HD > gettimetick(2) ) end; makeitem 1022, 10, "lunar01", rand(214, 217),rand(177,184); set .@Delay,1; // In Seconds if ( .@Delay ) set @HD, gettimetick(2)+.@Delay; end; } or lunar01,219,180,4 script Dreamworks Coins 807,5,5,{ OnTouch: if ( @delay_item ) end; @delay_item = 1; makeitem 1022, 10, "lunar01", rand(214, 217),rand(177,184); sleep2 1000; // 1000 = 1 sec of delay @delay_item = 0; // automatically reset the variable end; }
  17. Well this update cleaned the guild's buff of your guild test. You can clean it with the npc now. But if it works now forget it xD The important part was ALTER TABLE `guild` CHANGE `buff` `buff` varchar(255) NOT NULL default ''
  18. The script and the patch work in my local server so it can (I think)
  19. trunk/npc/custom/events/disguise.txt
  20. LOL I prefer this part I just add a gm access menu to clear the buff column - script flop -1,{ if( getgmlevel() > 80 ) { mes "Hi ^ff0000[GM]^000000 "+ strcharinfo(0) +" !"; mes "what can I do for you ?"; next; .@m = select( "Player menu", "Reset an upgrade's guild", "Clear all upgrade" ); if( .@m == 2 ) { .@size = query_sql( "SELECT `name` FROM `guild` ORDER BY `guild`.`name` ASC LIMIT 127", .@name_g$ ); .@tmp$ = "^777777~ next^000000"; for( .@i = 0; .@i < .@size; .@i += 10 ) { deletearray .@tmp$[1], 10; copyarray .@tmp$[1], .@name_g$[.@i], 10; .@menu_gm$ = implode( .@tmp$, ":" ); next; .@m_g = select( .@menu_gm$ ) -1; if( .@m_g == 0 && .@i + 10 >= .@size ) { mes "end of the list."; close; } else if( .@m_g != 0 ) break; } explode( .@a$, .@menu_gm$, ":" ); query_sql "update guild set buff = '' where name = '"+ .@a$[ .@m_g ] +"'"; mes "Column buff is now empty for guild "+ .@a$[ .@m_g ] +"."; close; } else if( .@m == 3 ) { query_sql "UPDATE `guild` set `buff` = ''"; mes "Column buff is now empty."; close; } } if( !getcharid(2) ) { mes "you are not in a guild !"; close; } else if( getguildmaster( getcharid(2) ) != strcharinfo(0) ) { mes "I only talk to your guildmaster, go away !"; close; } query_sql "SELECT buff FROM guild WHERE guild_id = "+ getcharid(2), .@buff_type$; if( getstrlen( .@buff_type$ ) ) explode( .@b$, .@buff_type$, "|" ); else { for( .@i = 0; .@i < .size_buff; .@i++ ) .@b$[.@i] = "0"; } mes "hello "+ strcharinfo(0) +", what do you want to up the skill in the guild healer today ?"; next; .@s = select( .menu$ ) -1; if( atoi(.@b$[.@s]) + .min_Levels == .max_Levels ) { mes "Your current "+ .skills_$[.@s] +" skill's guild healer has already reached the max level."; close; } mes "Your current "+ .skills_$[.@s] +" skill's healer is level ^0000ff("+ ( .min_Levels + atoi( .@b$[.@s] ) ) +")^000000."; mes "It will cost ^0000ff"+ ( .cost_[atoi(.@b$[.@s]) +1] * .rate_buff_zeny[.@s] ) +"^000000 zeny to up this skill for your guild."; next; if( select( "Paid to up "+ .skills_$[.@s], "Leave" ) -1 ) close; else if( Zeny < .cost_[atoi(.@b$[.@s]) +1] * .rate_buff_zeny[.@s] ) { mes "You're kidding me? you don't have enough zeny."; close; } Zeny = Zeny - .cost_[atoi(.@b$[.@s]) +1] * .rate_buff_zeny[.@s]; .@b$[.@s] = atoi( .@b$[.@s] ) +1; .@a$ = implode( .@b$, "|" ); query_sql "update guild set buff = '"+ .@a$ +"' where guild_id = "+ getcharid(2); mes "Your "+ .skills_$[.@s] +" skill's healer is now level ^0000ff("+ ( .min_Levels + atoi( .@b$[.@s] ) ) +")^000000. Congratulation !"; close; OnInit: deletearray .cost_; deletearray .skills_$; deletearray .skill_$; deletearray .min_Levels; deletearray .max_Levels; deletearray .rate_buff_zeny; setarray .skills_$, "agi", "bless", "Kyrie Eleison"; // add more skill here - think to add them also in the healer setarray .min_Levels, 5, 5, 0; // min level of the skill boost in the healer setarray .max_Levels, 10, 10, 10; // max level of the skill you can up setarray .rate_buff_zeny, 1, 1, 1; // rate for zeny - ex: 2 to kyrie -> cost *2 ; 2/5 -> cost *2/5 setarray .cost_[1], 10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000, 90000, 100000; // cost zeny to up the healer .size_buff = getarraysize( .skills_$ ); .menu$ = implode( .skills_$, ":" ); end; }
  21. Capuche

    Gamble NPC

    Change this part in the setting .max_hat_id = 5859; // max ID .min_hat_id = 5001; // min ID range .hat_type = 1|256|512; // delete this variable ( delete .hat_type ) and while( ( getiteminfo( .@r,5 )&.hat_type ) == 0 || compare( .black_list$, .@r +"" ) ); to while( getiteminfo( .@r,2 ) != 2 || compare( .black_list$, .@r +"" ) ); for Usable item or while( getiteminfo( .@r,2 ) != 3 || compare( .black_list$, .@r +"" ) ); for Etc item or while( ( getiteminfo( .@r,2 ) != 2 && getiteminfo( .@r,2 ) != 3 ) || compare( .black_list$, .@r +"" ) ); for etc + usable according to the table Type: 0 Healing item. 2 Usable item. 3 Etc item 4 Weapon 5 Armor/Garment/Boots/Headgear 6 Card 7 Pet egg 8 Pet equipment 10 Ammo (Arrows/Bullets/etc) 11 Usable with delayed consumption (item is lost from inventory after selecting a target, for use with skills and pet lures) 18 Another delayed consume that requires user confirmation before using item. @donkeyg What kind of error ?
  22. I mean this script consume too much permanent variable trunk/npc/custom/etc/floating_rates.txt
  23. If a guild A can buy multiple property, it would be a problem : if the guildmaster up 1 healer, the others healers from others property would be already up for this guild.
  24. If you try with my test array, I put some nonexistent ID I also tried and I don't have this kind of problem (lastest version too) So check if there are some errors in your mapserv when you click on the npc, otherwise I can't help you
×
×
  • Create New...