-
Posts
2407 -
Joined
-
Last visited
-
Days Won
52
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Capuche
-
I remember a launcher issue with a bug like that... Try with another launcher...
-
You miss one curly at the end of your script. Please check your mapserv before posting, your error is pretty clearly explained on it.
-
Like this ? - script B_branch -1,{ OnSpawn: if( input( .@s$, 1, 5 ) != 0 ) { message strcharinfo(0), "Wrong typo. <mob_ID>{M, S, L}. Example: 1002S for small poring. 1002 for normal poring."; end; } else if( atoi( .@s$ ) == 1 ) { killmonster strcharinfo(3), strnpcinfo(0) +"::OnMobDead"; end; } else if( strmobinfo( 4,atoi( .@s$ ) ) == 0 ) { message strcharinfo(0), "Unknown monster."; end; } else if( getstrlen( .@s$ ) > 4 ) { while( .@size_m < 3 && strtoupper( charat( .@s$,4 ) ) != .size_typo$[.@size_m] ) .@size_m++; if( .@size_m == 3 || atoi( delchar( .@s$,4 ) ) == 0 ) { message strcharinfo(0), "Wrong typo."; end; } } else if( countitem( .item_id ) < 1 ) { message strcharinfo(0), "You need 1 "+ getitemname( .item_id ) +"."; end; } monster "this",-1,-1,"--ja--",atoi( .@s$ ),1, strnpcinfo(0) +"::OnMobDead", .@size_m; delitem .item_id,1; end; OnInit: setarray .size_typo$, "M", "S" ,"L"; .item_id = 12103; // Bloody branch ID OnMobDead: end; } 12103,Bloody_Dead_Branch,Bloody Branch,11,10000,,200,,,,,0xFFFFFFFF,7,2,,,,,,{ doevent "B_branch::OnSpawn"; },{},{} What if you want to summon a mob with ID 2000 ? I change the typo message strcharinfo(0), "Wrong typo. <mob_ID>{M, S, L}. Example: 1002S for small poring. 1002 for normal poring."; In my script, all monsters with this label will disappear (all monsters summoned with BB by all players on the map). If you only want to kill the monster summoned by the player, I think you need source modification.
-
prontera,150,193,4 script Reset Girl 124,{ mes "[Reset Girl]"; mes "I am the Reset Girl."; mes "Reset Stats: "+ .count_Stat +" "+ getitemname( .ResetStat ); mes "Reset Skills: "+ .count_Skill +" "+ getitemname( .ResetSkill ); mes "Reset Both: "+ .count_Both +" "+ getitemname( .ResetBoth ); mes "Please select the service you want:"; next; switch(select("^FF3355Reset Skills:Reset Stats:Reset Both^000000:Cancel")) { case 1: mes "[Reset Girl]"; if ( countitem( .ResetSkill ) < .count_Skill ) { mes "Sorry, you don't have enough Items."; close; } delitem .ResetSkill, .count_Skill; sc_end SC_ALL; ResetSkill; mes "There you go!"; close; case 2: mes "[Reset Girl]"; if ( countitem( .ResetStat ) < .count_Stat ) { mes "Sorry, you don't have enough Items."; close; } delitem .ResetStat, .count_Stat; ResetStatus; mes "There you go!"; close; case 3: mes "[Reset Girl]"; if ( countitem( .ResetBoth ) < .count_Both ) { mes "Sorry, you don't have enough Items."; close; } delitem .ResetBoth, .count_Both; sc_end SC_ALL; ResetSkill; ResetStatus; mes "There you go!"; close; case 4: close; } OnInit: set .ResetStat, 501; // item stat reset set .count_Stat, 1; // number of item need for stat reset set .ResetSkill, 501; // item for skill reset set .count_Skill, 1; // number of item need for skill reset set .ResetBoth, 501; // item for resetting both together set .count_Both, 2; // number of item need for Bothtogether end; } The setting : OnInit: set .ResetStat, 501; // item stat reset set .count_Stat, 1; // number of item need for stat reset set .ResetSkill, 501; // item for skill reset set .count_Skill, 1; // number of item need for skill reset set .ResetBoth, 501; // item for resetting both together set .count_Both, 2; // number of item need for Bothtogether
-
Can you help me?Cash point to KVM point (glorious)
Capuche replied to deceel's question in Script Requests
Emistry. Don't change his gender lol Do you use rAthena ? if so post your current script please. -
/* ||======================================================|| ||======================================================|| || NPC: || ||======================================================|| || Evolution Wings || ||======================================================|| || Version 1.3 || ||======================================================|| || Made by Streiker || ||======================================================|| || Updates: || || (5 latests) || || Version 1.1: || || Fixed: The npc didn't work. || || Added new configs. || || Changed the exp rates system. || || || || Version 1.1.1: || || Fixed: Mistakes. || || || || Version 1.2: || || Added rahuldev345 suggestion (spec. mobs)|| || Added AnnieRuru suggestion (refine) || || || || Version 1.3: || || Added new mode, new confs, new vars. || ||======================================================|| || Description: || || || || Make easily "evolution wings" with this. || ||======================================================|| || Additional Comments: || || || || At the moment none. || ||======================================================|| ||======================================================|| */ - script Wings_Conf -1,{ OnInit: /* Evolution modes: 1 = Every X numer of mobs (1%). 2 = Experience (1%). 3 = Every X number of mobs (100%). */ set .modo, 1; set .rates, 100; // % (Only for Mode 2). /* ID[...], evolution mode[...], mob id[...], neccesary to advance 1%[...]. (Configured for the 1st mode). If you want any monster, use 111. // Use callsub for add more wings. */ callsub Ids, 2573, 1, 1002, 20, 19002, 1, 111, 25, 19003, 1, 111, 30, 19004, 1, 111, 0 ; /* 0 = Won't evolved automatically. 1 = Will be evolved automatically */ set .auto, 1; // Delay of evolution (miliseconds). set .time, 3000; // Announces color. setarray .c$[0],"4db557", // % of evolution. "d43438", // Wings evolving. "4da5b5"; // Wings evolved. setarray .slots[0], 1, 9, 10; // put here your slots. set .size_slots, getarraysize( .slots ); end ; Ids: set .w1, .w1 + 1; for ( set .@a, 0; getarg ( .@a, 0 ) != 0 ; set .@a, .@a + 4 ) { set .w2[.w1 - 1], .w2[.w1 - 1] + 1; setd ".a1"+ .w1 +"_"+ .w2[.w1 - 1], getarg ( .@a ); // id. setd ".a2"+ .w1 +"_"+ .w2[.w1 - 1], getarg ( .@a + 1 ); // mode. setd ".a3"+ .w1 +"_"+ .w2[.w1 - 1], getarg ( .@a + 2 ); // mob id. setd ".a4"+ .w1 +"_"+ .w2[.w1 - 1], getarg ( .@a + 3 ); // amount. } return ; OnNPCKillEvent: for ( set .@i, 0; .@i < .size_slots ; set .@i, .@i + 1 ) { set .@e, getequipid ( .slots[.@i] ); if( .@e != -1 ) { for ( set .@a, 0; .@a < .w2[.@w] ; set .@a, .@a + 1 ) { set .@id, .@id + 1; if ( .@id == .w2[.@w] ) { set .@id, 0; set .@w, .@w + 1; set .@a, 0; } if ( .@e == getd ( ".a1"+ ( .@w + 1 ) +"_"+ .@id ) && getd ( ".a4"+ ( .@w + 1 ) +"_"+ .@id ) && ( killedrid == getd ( ".a3"+ ( .@w + 1 ) +"_"+ .@id ) || getd ( ".a3"+ ( .@w + 1 ) +"_"+ .@id ) < 1001 ) ) { set .@c, 1; break ; } sleep2 ( ! ( .@a % 100 ) ) ; } } if( .@c ) break; } if ( !.@c ) end ; set .@e2, getd ( "evo"+ .@e ); if ( getd ( ".a2"+ ( .@w + 1 ) +"_"+ .@id ) == 1 ) { setd "$Mobs_"+ getcharid ( 0 ) +"_"+ .@e, getd("$Mobs_"+ getcharid( 0 ) +"_"+ .@e ) + 1; if ( ( getd ( "$Mobs_"+getcharid ( 0 ) ) % getd ( ".a4"+ ( .@w + 1 ) +"_"+ .@id ) ) ) end ; setd "evo"+ .@e, getd ( "evo"+ .@e ) + 1; setd "$Mobs_"+ getcharid ( 0 ) +"_"+ .@e, 0; } else if ( getd ( ".a2"+ ( .@w + 1 ) +"_"+ .@id ) == 2 ) { setd "$Exp_"+ getcharid ( 0 ) +"_"+ .@e, getd ("$Exp_"+ getcharid ( 0 ) +"_"+ .@e ) + ( strmobinfo ( 6, killedrid ) * .rates / 100 ); if ( getd ( "$Exp_"+getcharid ( 0 ) +"_"+ .@e ) < getd ( ".a4"+ ( .@w + 1 ) +"_"+ .@id ) ) end ; setd "evo"+ .@e, getd ( "evo"+ .@e ) + 1; setd "$Exp_"+ getcharid ( 0 ), 0; } else if ( getd ( ".a2"+ ( .@w + 1 ) +"_"+ .@id ) == 3 ) { setd "$Mobs_"+ getcharid ( 0 ), getd ("$Mobs_"+ getcharid( 0 ) +"_"+ .@e ) + 1; if ( ( getd ( "$Mobs_"+ getcharid ( 0 ) +"_"+ .@e ) % getd ( ".a4"+ ( .@w + 1 ) +"_"+ .@id ) ) ) end ; setd "evo"+ .@e, getd ( "evo"+ .@e ) + 100; setd "$Mobs_"+ getcharid ( 0 ) +"_"+ .@e, 0; } else debugmes "Script Wings_Evo, error: wrong mode configuration."; if ( .@e2 != getd ( "evo"+ .@e ) ) { announce getd ( "evo"+ .@e ) +"% "+ getitemname ( .@e ) , bc_self, "0x"+ .c$[0] ; specialeffect2 58 ; sleep2 200 ; specialeffect2 383 ; } if ( getd ( "evo"+ .@e ) == 100 && .auto ) { specialeffect2 263 ; sleep2 500 ; specialeffect2 377 ; sleep2 300 ; specialeffect2 542 ; sleep2 300 ; announce getitemname ( .@e ) +" evolving..." , bc_self, "0x"+ .c$[1] ; if ( .time ) sleep2 .time ; specialeffect2 463 ; sleep2 200; specialeffect2 665 ; sleep2 500 ; //specialeffect2 437 ; setarray .@card[1], getequipcardid ( .slots[.@i], 0 ), getequipcardid ( .slots[.@i], 1 ), getequipcardid ( .slots[.@i], 2 ), getequipcardid ( .slots[.@i], 3 ); set .@refine, getequiprefinerycnt ( .slots[.@i] ); delitem .@e, 1 ; getitem2 getd ( ".a1"+ ( .@w + 1 ) +"_"+ ( .@id + 1 ) ) , 1, 1, .@refine, 0, .@card[1], .@card[2], .@card[3], .@card[4] ; equip getd ( ".a1"+ ( .@w + 1 ) +"_"+ ( .@id + 1 ) ) ; setd "evo"+ .@e, 0; announce "Congratulations, your wings have evolved to "+ getitemname ( getd ( ".a1"+ ( .@w + 1 ) +"_"+ ( .@id + 1 ) ) ) +"." , bc_self , "0x"+ .c$[2] ; } end; } Interesting idea
-
Kill notification (chat box only not broadcast)
Capuche replied to hyuna's question in Script Requests
OnPCDIeEvent: will also trigger when you are killed by monster - script fghk -1,{ OnPCKillEvent: message strcharinfo(0), "You killed "+ rid2name(killedrid) ; message rid2name(killedrid), "You have been killed by "+ strcharinfo(0) ; end; } -
You must restart your mapserv (@reloadscript)
-
I don't have this kind of problem on my local My Exit NPC is disabled when the event start
-
Search again, I found plenty of getitem
-
Special effect scripts make my client crash?
Capuche replied to donkeyg's question in Scripting Support
About the script while(1){ specialeffect 349; } == mapserv display an infinite loop What I should do is something like this izlude,129,149,4 script Waterfall#h1-1::Waterfall 100,12,12,{ OnInit: hideonnpc strnpcinfo(1); end; OnTouch: specialeffect 349; end; } -
Then try this one //===== eAthena Script ===================================================================== //= Fact Event //===== By: ================================================================================ //= Hellflaem //===== Current Version: =================================================================== //= 1.0 //===== Compatible With: =================================================================== //= Eathena SVN and 3ceam //===== Description: ======================================================================= //= It's a Facts Event based on about 52 Facts from the Facts Announcer Script by xienne15. //= The Event is started by players, They just have to click the npc. //= Players are asked to fill in the missing word(s) of the facts. //= If they get it right they get an item. Player just have to say the answer outloud. //========Credits=========================================================================== //=ToastOfDoom //=RxChris //========================================================================================== mora,137,171,3 script Facts Event 917,{ end; function DefineQuestion; function GetQuestion; function GetAnswer; OnMinute20: OnMinute40: OnMinute00: announce "The fact Event will begin in 3 minutes.",bc_all | bc_blue; announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue; sleep 60000; announce "The fact Event will begin in 2 minutes.",bc_all | bc_blue; announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue; sleep 60000; announce "The Fact Event will begin 1 minute.",bc_all | bc_blue; announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue; sleep 60000; announce "The fact Event has begun!",bc_all | bc_blue; announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue; L_loop: freeloop(1); do { set .@i, rand( .numQuestions ); // Randomly picks a fact. .@c++; } while( callsub( L_check, .@i ) && .@c < 100 ); freeloop(0); callsub( L_check, .@i, 0 ); if( !.count ) { npctalk "Sila isi dalam tempat kosong:"; sleep 2000; npctalk "Jika anda rasa ia betul. Saya akan memberikan anda beberapa syiling poring!"; } .count++; sleep 4000; npctalk "Fact: " + GetQuestion(.@i); defpattern 1, "([^:]+):.*\\s"+ GetAnswer( .@i ) +"(.*)", "Right"; activatepset 1; initnpctimer; end; OnTimer30000: npctalk "Maaf, anda mengambil masa yang amat panjang."; goto L_continue; Right: npctalk "Itu adalah betul, sila ambil ini."; getitem .rewarditem, rand( 1,500 ); // Randomly picks from 1 to 5. L_continue: deletepset 1; stopnpctimer; if( .count < .max_questions ) goto L_loop; .count = 0; // end of event while( getd( ".Q_session"+ .@j ) ) { setd ".Q_session"+ .@j, 0; .@j++; } npctalk "end of event"; end; L_check: .@i = getarg(0); while( .@j * 30 < .@i ) .@j++; .@j--; .@tmp = .@i - .@j * 30; if( getarg( 1,1 ) ) return getd( ".Q_session"+ .@j ) & 1 << .@tmp; else { setd ".Q_session"+ .@j, getd( ".Q_session"+ .@j ) | 1 << .@tmp; return; } function DefineQuestion { set .@a, .numQuestions % 128; set .@b, .numQuestions / 128; setd(".question_" + .@a + "$[" + .@b + "]", getarg(0)); setd(".answer_" + .@a + "$[" + .@b + "]", getarg(1)); set .numQuestions, .numQuestions + 1; return; } function GetQuestion { return getd(".question_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } function GetAnswer { return getd(".answer_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } OnInit: set .rewarditem, 7539; //Poring Coins .max_questions = 10; // 10 questions if more than 10 questions are defined DefineQuestion("What is your mum name ? _____ ","poring"); DefineQuestion("What is your father name ? _____ ","poporing"); if( .numQuestions < .max_questions ) .max_questions = .numQuestions; end; } ~unlimit fact
-
That means at 00, 20, 40 minutes the event start. - There is a broadcast every minute (3, 2, 1 min) then the questions are asked - the npc ask max 10 questions but just 3 if you set just 3 questions etc.. - the npc doesn't ask the same question in the same event - you can set 32 questions max in the setting (tell me if you want exceed this limit)
-
while( .@i < 4 && getequipcardid( EQI_HEAD_MID,.@i ) != 4198 ) .@i++; if( .@i == 4 ) { mes "You need to wear a middle headgear and a maya purple to continue."; close; } close; EDIT: you're too fast Euphy
-
prontera,155,180,5 script Random 98,{ mes .npc_name$; mes "Hello, do you want to play ?"; next; if( select( "Play !", "More Informations", "Leave" ) == 3 ) { mes .npc_name$; mes "Bye!~"; close; } else if( @menu == 2 ) { while( getd(".p"+ .@j ) ) { mes .npc_name$; mes "Item required: ^FFCC00"+ getitemname( getd(".p"+ .@j ) ) +"^000000"; mes "Chance to gain something: ^CC0000"+ getd(".p"+ .@j +"[1]" ) +"%^000000"; mes "Possible gains:"; for( .@i = 3; .@i < getarraysize( getd(".p"+ .@j ) ); .@i += 3 ) mes "^0000FFx"+ getd(".p"+ .@j +"["+ .@i +"]" ) +"^000000 "+ getitemname( getd(".p"+ .@j +"["+ (.@i -1) +"]" ) ) +" (^CC0000"+ getd(".p"+ .@j +"["+ (.@i +1) +"]" ) +"%^000000)"; .@j++; next; } } mes .npc_name$; mes "Which item do you want to use ?"; next; for( .@j = 0; getd(".p"+ .@j ); .@j++ ) if( countitem( getd(".p"+ .@j ) ) ) { .@size = getarraysize( .@menu$ ); .@menu$[ .@size ] = getitemname( getd(".p"+ .@j ) ); .@sel[ .@size ] = .@j; } .@s = .@sel[ select( implode( .@menu$, ":" ) ) -1 ]; mes .npc_name$; while (1) { mes "Here we go..."; delitem getd(".p"+ .@s ), 1; if( rand(100) > getd(".p"+ .@s +"[1]" ) )// lose mes "You got nothing"; else { .@rand = rand( getd(".totalchance"+ .@s ) ); .@r = 1; while ( ( .@rand = .@rand - getd( ".p"+ .@s +"["+ (1+ 3 * .@r) +"]" ) ) >= 0 ) .@r++; getitem getd( ".p"+ .@s +"["+ (1+ 3*.@r -2) +"]" ), getd( ".p"+ .@s +"["+( 1+3*.@r -1 )+"]" ); mes "You got ^FF00CC"+ getd( ".p"+ .@s +"["+( 1+3*.@r -1 )+"]" ) +" "+ getitemname( getd( ".p"+ .@s +"["+ (1+ 3*.@r -2) +"]" ) ) +"^000000"; } mes " "; mes "wanna try again ?"; next; if ( select( "Yes", "No" ) == 2 ) close; mes .npc_name$; if ( countitem( getd(".p"+ .@s ) ) < 1 ) { mes "it seems you have ran out of "+ getitemname( getd(".p"+ .@s ) ); close; } } close; OnInit: // (item ID need) (chance), (reward 1) (number of reward 1) (chance to gain), (reward 2) (number of reward 2) (chance to gain)... setarray .p0, 671,50, 2462,1,20, 1161,1,30, 5394,1,50; // gold coin setarray .p1, 7227,20, 2462,1,10, 2541,1,10, 1161,1,10, 13517,1,70; while ( getd(".p"+ .@j ) ) { for( .@i = 4; .@i < getarraysize( getd(".p"+ .@j ) ); .@i += 3 ) setd ".totalchance"+ .@j, getd(".totalchance"+ .@j ) + getd(".p"+ .@j +"["+ .@i +"]" ); .@j++; } .npc_name$ = "[ "+ strnpcinfo(1) +"]"; end; } This option is set here // (item ID need) (chance), (reward 1) (number of reward 1) (chance to gain), (reward 2) (number of reward 2) (chance to gain)... setarray .p0, 671,50, 2462,1,20, 1161,1,30, 5394,1,50; // gold coin setarray .p1, 7227,20, 2462,1,10, 2541,1,10, 1161,1,10, 13517,1,70; You can add more reward or add an other list following the typo I wrote
-
//===== eAthena Script ===================================================================== //= Fact Event //===== By: ================================================================================ //= Hellflaem //===== Current Version: =================================================================== //= 1.0 //===== Compatible With: =================================================================== //= Eathena SVN and 3ceam //===== Description: ======================================================================= //= It's a Facts Event based on about 52 Facts from the Facts Announcer Script by xienne15. //= The Event is started by players, They just have to click the npc. //= Players are asked to fill in the missing word(s) of the facts. //= If they get it right they get an item. Player just have to say the answer outloud. //========Credits=========================================================================== //=ToastOfDoom //=RxChris //========================================================================================== mora,137,171,3 script Facts Event 917,{ end; function DefineQuestion; function GetQuestion; function GetAnswer; OnMinute20: OnMinute40: OnMinute00: announce "The fact Event will begin in 3 minutes.",bc_all | bc_blue; announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue; sleep 60000; announce "The fact Event will begin in 2 minutes.",bc_all | bc_blue; announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue; sleep 60000; announce "The Fact Event will begin 1 minute.",bc_all | bc_blue; announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue; sleep 60000; announce "The fact Event has begun!",bc_all | bc_blue; announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue; L_loop: do set .@i, rand( .numQuestions ); // Randomly picks a fact. while( .Q_session & 1 << .@i && .Q_session && .count < .numQuestions ); set .Q_session, .Q_session | 1 << .@i;// max 32 questions if( !.count ) { npctalk "Sila isi dalam tempat kosong:"; sleep 2000; npctalk "Jika anda rasa ia betul. Saya akan memberikan anda beberapa syiling poring!"; } .count++; sleep 4000; npctalk "Fact: " + GetQuestion(.@i); defpattern 1, "([^:]+):.*\\s"+ GetAnswer( .@i ) +"(.*)", "Right"; activatepset 1; initnpctimer; end; OnTimer30000: npctalk "Maaf, anda mengambil masa yang amat panjang."; goto L_continue; Right: npctalk "Itu adalah betul, sila ambil ini."; getitem .rewarditem, rand( 1,500 ); // Randomly picks from 1 to 5. L_continue: deletepset 1; stopnpctimer; if( .count < .max_questions ) goto L_loop; // loop 10 questions .count = 0; // end of event .Q_session = 0; npctalk "end of event"; end; function DefineQuestion { set .@a, .numQuestions % 128; set .@b, .numQuestions / 128; setd(".question_" + .@a + "$[" + .@b + "]", getarg(0)); setd(".answer_" + .@a + "$[" + .@b + "]", getarg(1)); set .numQuestions, .numQuestions + 1; return; } function GetQuestion { return getd(".question_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } function GetAnswer { return getd(".answer_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } OnInit: set .EventON, 0; set .rewarditem, 7539; //Poring Coins .max_questions = 10; // 10 questions if more than 10 questions are defined DefineQuestion("What is your mum name ? _____ ","poring"); DefineQuestion("What is your father name ? _____ ","poporing"); if( .numQuestions < .max_questions ) .max_questions = .numQuestions; end; } ~ I add after OnMinute OnMinute00: announce "The fact Event will begin in 3 minutes.",bc_all | bc_blue; announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue; sleep 60000; announce "The fact Event will begin in 2 minutes.",bc_all | bc_blue; announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue; sleep 60000; announce "The Fact Event will begin 1 minute.",bc_all | bc_blue; announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue; sleep 60000; announce "The fact Event has begun!",bc_all | bc_blue; announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue;
-
//===== eAthena Script ===================================================================== //= Fact Event //===== By: ================================================================================ //= Hellflaem //===== Current Version: =================================================================== //= 1.0 //===== Compatible With: =================================================================== //= Eathena SVN and 3ceam //===== Description: ======================================================================= //= It's a Facts Event based on about 52 Facts from the Facts Announcer Script by xienne15. //= The Event is started by players, They just have to click the npc. //= Players are asked to fill in the missing word(s) of the facts. //= If they get it right they get an item. Player just have to say the answer outloud. //========Credits=========================================================================== //=ToastOfDoom //=RxChris //========================================================================================== mora,137,171,3 script Facts Event 917,{ end; function DefineQuestion; function GetQuestion; function GetAnswer; OnMinute20: OnMinute40: OnMinute00: do set .@i, rand( .numQuestions ); // Randomly picks a fact. while( .Q_session & 1 << .@i && .Q_session && .count < .numQuestions ); set .Q_session, .Q_session | 1 << .@i;// max 32 questions if( !.count ) { npctalk "Sila isi dalam tempat kosong:"; sleep 2000; npctalk "Jika anda rasa ia betul. Saya akan memberikan anda beberapa syiling poring!"; } .count++; sleep 4000; npctalk "Fact: " + GetQuestion(.@i); defpattern 1, "([^:]+):.*\\s"+ GetAnswer( .@i ) +"(.*)", "Right"; activatepset 1; initnpctimer; end; OnTimer30000: npctalk "Maaf, anda mengambil masa yang amat panjang."; goto L_continue; Right: npctalk "Itu adalah betul, sila ambil ini."; getitem .rewarditem, rand( 1,500 ); // Randomly picks from 1 to 5. L_continue: deletepset 1; stopnpctimer; if( .count < .max_questions ) goto OnMinute00; // loop 10 questions .count = 0; // end of event .Q_session = 0; npctalk "end of event"; end; function DefineQuestion { set .@a, .numQuestions % 128; set .@b, .numQuestions / 128; setd(".question_" + .@a + "$[" + .@b + "]", getarg(0)); setd(".answer_" + .@a + "$[" + .@b + "]", getarg(1)); set .numQuestions, .numQuestions + 1; return; } function GetQuestion { return getd(".question_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } function GetAnswer { return getd(".answer_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } OnInit: set .EventON, 0; set .rewarditem, 7539; //Poring Coins .max_questions = 10; // 10 questions if more than 10 questions are defined DefineQuestion("What is your mum name ? _____ ","poring"); DefineQuestion("What is your father name ? _____ ","poporing"); if( .numQuestions < .max_questions ) .max_questions = .numQuestions; end; }
-
and this is my fix prontera,151,182,5 script Donation NPC 807,{ // ==== NPC Talk ============================== // if( getgmlevel() < .gms_level) goto PlayerPanel; // ==== Admin Panel =========================== // mes .npc_name$; mes "Welcome " + strcharinfo(0) + "."; next; switch( select("Add Donation Code:Player View:Exit") ) { case 1: for( set .@i, 0; .@i < .code_length; set .@i, .@i +1 ) { set .@random_char, rand( .size_coupon ); set .@new_donation$, .@new_donation$ + .coupon_code$[ .@random_char ]; } for( set .@i, 0; .@i < .code_length2; set .@i, .@i+1 ) { set .@random_char, rand( .size_valid ); set .@new_validation$, .@new_validation$ + .validation_code$[ .@random_char ]; } mes .npc_name$; mes "Enter Item Amount (1-99):"; if( input( .@donate_amount, 1, 99 ) != 0 ) { mes "Wrong amount."; close; } next; mes .npc_name$; mes "Coupon added."; query_sql "INSERT INTO `donate` (`code`, `item_amount`,`validation_code`,`status`) VALUES ('"+ .@new_donation$ +"', "+ .@donate_amount +", '"+ .@new_validation$ +"' , '0')"; next; mes "This is the list of code logs"; set .@size_list, query_sql( "SELECT `code` , `item_amount` , `validation_code` FROM `donate` ORDER BY `code` DESC", .@codelist$, .@amount, .@validation$ ); if( !.@size_list ) { mes .@npcname$; mes "There are no entrys in the Code List."; close; } else { next; mes .@npcname$; mes "The list will spawn at your main chat box."; dispbottom "Codelist | Amount | Validation"; for(set .@i,0; .@i < .@size_list; set .@i, .@i +1 ) dispbottom ""+.@codelist$[.@i]+" | "+.@amount[.@i]+" | "+.@validation$[.@i]+" "; } close; case 2: break; case 3: L_quit: mes .npc_name$; mes "Have a nice day."; close; } // ==== Player Panel ========================== // PlayerPanel: mes .npc_name$; mes "Welcome to the Donation System. How can I help you?"; next; switch( Select("View My Donation Code:Enter My Donation Code:Exit") ) { case 1: mes .npc_name$; mes "Please enter your Validation Code:"; input .@my_code$; query_sql "SELECT `validation_code` FROM `donate` WHERE `validation_code` = '"+ escape_sql( .@my_code$ ) +"'", .@available_code$; next; if( .@my_code$ == .@available_code$ ) { query_sql "SELECT `code` FROM `donate` WHERE `validation_code` = '"+ escape_sql( .@my_code$ ) +"'", .@available_code2$; mes .npc_name$; mes "Your Donation Code is : [^FF7700" + .@available_code2$+ "^000000]."; } else { mes .npc_name$; mes "Your Validation Code is Invalid."; } close; case 2: mes .npc_name$; mes "Please enter your Donation Code:"; input .@donate_code$; next; query_sql "SELECT `code`, `status` FROM `donate` WHERE `code` = '"+ escape_sql( .@donate_code$ ) +"'", .@donation_code$, .@donate_status; if( strtoupper( .@donate_code$ ) == .@donation_code$ && .@donate_status == 0 ) { if( .itemORcash == 0 ) { query_sql "SELECT `item_amount` FROM `donate` WHERE `code` = '"+ escape_sql( .@donate_code$ ) +"'", .@Donation_Code$; mes .npc_name$; mes "You get ^0000FF" + getitemname( .donate_item ) + " - " + .@Donation_Code$ + " ea.^000000"; query_sql "UPDATE `donate` SET `status`=1 WHERE `code`='"+ escape_sql( .@donate_code$ ) +"'"; close2; //query_sql "DELETE FROM `donate` WHERE `code`='"+@donate_code$+"'"; getitem .donate_item, atoi( .@Donation_Code$ ); } else { query_sql "SELECT `item_amount` FROM `donate` WHERE `code` = '"+ escape_sql( .@donate_code$ ) +"'", .@Donation_Code$; mes .npc_name$; mes "You get ^0000FF" + .@Donation_Code$ + " Cash Point.^000000"; query_sql "UPDATE `donate` SET `status`=1 WHERE `code`='"+ escape_sql( .@donate_code$ ) +"'"; close2; //query_sql "DELETE FROM `donate` WHERE `code`='"+@donate_code$+"'"; set #CASHPOINTS, #CASHPOINTS + atoi( .@Donation_Code$ ); } end; } else { mes .npc_name$; mes "This Donation Code doesn't exist."; close; } case 3: goto L_quit; } // ============================================ // OnInit: query_sql "CREATE TABLE IF NOT EXISTS `donate` (`code` TINYTEXT NOT NULL, `item_amount` INT NOT NULL, `validation_code` TEXT NOT NULL, `status` TEXT NOT NULL, INDEX `code` (`code`(32)) ) ENGINE=MyISAM"; query_sql "CREATE TABLE IF NOT EXISTS `donation` (`name` TEXT NOT NULL, `code` TEXT NOT NULL, `item_amount` INT NOT NULL, `validation_code` TEXT NOT NULL, INDEX `code` (`code`(32)) ) ENGINE=MyISAM"; // === Configuration ========================== // set .gms_level, 99; set .code_length,5; // Length for the Donation Code set .code_length2,3; // Length for the Validation Code set .donate_item, 7179; // Donation Item set .itemORcash, 0; // 0 for Item or 1 for Cash Point set .npc_name$, "Donation Npc"; setarray .coupon_code$[0],"A","B","C","D","E","F","G","H","I","J","K","L", "M","N","O","P","Q","R","S","T","U","V","W","X", "Y","Z","0","1","2","3","4","5","6","7","8","9"; setarray .validation_code$[0],"A","B","C","D","E","F","G","H","I","J","K","L", "M","N","O","P","Q","R","S","T","U","V","W","X", "Y","Z","0","1","2","3","4","5","6","7","8","9"; set .size_coupon, getarraysize( .coupon_code$ ); set .size_valid, getarraysize( .validation_code$ ); end; }
-
Try this - script KoE -1,{ OnInit: disablenpc "The King#KoE"; disablenpc "Exit#KoE"; end; OnWhisperGlobal: if ( getgmlevel() < 99 ) end; else if ( compare ( @whispervar0$, "on" ) ) goto L_start; else if ( compare ( @whispervar0$, "off" ) ) goto L_end; else end; L_end: announce "The King of Emperium Hill is over!", 0; set .koe_start, 0; enablenpc "Exit#KoE"; disablenpc "The King#KoE"; killmonsterall "guild_vs1"; end; L_start: announce "The King of Emperium Hill has begun!", 0; set .koe_start, 1; enablenpc "The King#KoE"; disablenpc "Exit#KoE"; set $koegid, 0; donpcevent "::OnRevKoE"; maprespawnguildid "guild_vs1", $koegid, 6; monster "guild_vs1",49,49,"Emperium",1288,1,"KoE::OnEmpDead"; end; OnEmpDead: set $koegid, getcharid(2); announce "The current King of Emperium Hill is the [ " + strcharinfo(2) + " ] guild.", 0; donpcevent "::OnRevKoE"; maprespawnguildid "guild_vs1", $koegid, 6; sleep 500; if ( .koe_start ) monster "guild_vs1",49,49,"Emperium",1288,1,"KoE::OnEmpDead"; end; } // KoE Entrance gonryun,156,139,5 script The King#KoE 459,{ mes "[ The King ]"; if ( getcharid(2) == 0 ) { mes "You must have a guild to participate in the ^FF0000King of Emperium Hill Tournament^000000."; close; } mes "Hello."; mes "Would you like to participate in the ^FF0000King of Emperium Hill Tournament^000000?"; if ( select ( "Yes", "No" ) == 2 ) close; switch( rand(1,4) ){ case 1: warp "guild_vs1", 50, 88; end; case 2: warp "guild_vs1", 88, 50; end; case 3: warp "guild_vs1", 50, 11; end; case 4: warp "guild_vs1", 11, 50; end; } } // KoE Exit guild_vs1,49,56,5 script Exit#KoE 51,{ mes "[Exit]"; mes "See ya."; next; if ( getcharid(2) == $koegid && getcharid(2) ) { .@size_guild = query_sql( "SELECT `account_id`, `char_id` FROM `guild_member` WHERE `guild_id` = '"+ getcharid(2) +"'", .@account_id, .@char_id ); for( .@i = 0; .@i < .@size_guild; .@i++ ) if( isloggedin( .@account_id[.@i], .@char_id[.@i] ) ) getitem 607, 50; // configure prize here warpguild "SavePointAll",0,0,getcharid(2); } warp "Save",0,0; close; } // Flags guild_vs1,49,38,4 script King of Emperium Hill#1::koe_flag 722,{ set .@gid, $koegid; if ( .@gid == 0 ) end; mes "[ King of Emperium Hill ]"; mes "The Current King of Emperium Hill is the [ "+ getguildname(.@gid) +" ] guild."; close; OnRevKoE: flagemblem $koegid; end; } guild_vs1,61,49,6 duplicate(koe_flag) King of Emperium Hill#2 722 guild_vs1,38,49,2 duplicate(koe_flag) King of Emperium Hill#3 722 guild_vs1,49,61,0 duplicate(koe_flag) King of Emperium Hill#4 722 guild_vs1 mapflag gvg guild_vs1 mapflag nobranch guild_vs1 mapflag nomemo guild_vs1 mapflag nopenalty guild_vs1 mapflag noreturn guild_vs1 mapflag nosave SavePoint guild_vs1 mapflag noteleport guild_vs1 mapflag gvg_noparty guild_vs1 mapflag nowarp guild_vs1 mapflag nowarpto
-
I don't see any problem in this script (unless the price of Jellopy but no need to worry).
-
There is already a SC_COMA (line 7828), there won't be a conflict ?
-
It's not an event, it's a NPC to exchange something to another
-
Maybe with Mapflag#restricted.txt Example alde_tt02 mapflag restricted 1 In db/re/skill_nocast_db.txt 10013,32 // (10013 = skill ID emergency recall) (32 = zone 1 restricted)
-
OnBreakEmp: // put doevent under OnAgitBreak ... query_sql "insert into woe_point values ( "+ getcharid(2) +", 1 ) on duplicate key update points = points +1"; end; Leave this alone in the script In guild/agit_main.txt add after OnAgitBreak: doevent "Woe Points::OnBreakEmp";
-
Yes