Erba Posted May 17, 2014 Posted May 17, 2014 Requesting a script that requires a player to kill monsters in any maps they wanted.. every time they kill a monster(specified by a gm) they obtain 1 hunting point and only a maximum of 1000 hunting points to be obtain per character GM automated: @monsterhunt a gm lvl 25 can change the Monster to be killed inorder to obtain poring point Quote
Capuche Posted May 18, 2014 Posted May 18, 2014 prontera,150,180,5 script Hunter monster 87,{ end; OnEvent: waitingroom "Mob to hunt: "+ getmonsterinfo( getvariableofnpc( .monster_hunt_id,"atcmd_monsterhunt" ),0 ) + " (ID: " + getvariableofnpc( .monster_hunt_id,"atcmd_monsterhunt" ) + ")",0; } - script atcmd_monsterhunt -1,{ OnInit: bindatcmd "monsterhunt",strnpcinfo(3)+"::OnCmd"; end; OnCmd: if ( .monster_hunt_id == 0 && ( .@atcmd_numparameters == 0 || .@atcmd_parameters$[0] == "on" || .@atcmd_parameters$[0] == "off" ) ) dispbottom "there is none monster to hunt"; else if ( .@atcmd_numparameters == 0 ) dispbottom "the new monster to hunt is " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ")"; else if ( .@atcmd_parameters$[0] == "on" ) { if ( @display_message == 0 ) dispbottom "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") already display a message"; else { dispbottom "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") will display a message"; @display_message = 0; } } else if ( .@atcmd_parameters$[0] == "off" ) { if ( @display_message == 1 ) dispbottom "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") already don't display a message"; else { dispbottom "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") won't display a message"; @display_message = 1; } } else if ( getgmlevel() >= 25 ) { if ( .@atcmd_parameters$[0] == "0" ) { dispbottom "you stop the hunt"; .monster_hunt_id = 0; delwaitingroom "Hunter monster"; } else { .@mob_name$ = getmonsterinfo( atoi(.@atcmd_parameters$[0]),0 ); if ( .@mob_name$ == "null" ) dispbottom "wrong mob id"; else { .monster_hunt_id = atoi(.@atcmd_parameters$[0]); dispbottom "the new monster to hunt is "+ .@mob_name$ + " (ID: " + .monster_hunt_id + ")"; donpcevent "Hunter monster::OnEvent"; } } } else dispbottom "@" + .@atcmd_command$ + " failed. @" + .@atcmd_command$ + " to display the mob to hunt. @" + .@atcmd_command$ + " on/off to display a message killing the mob"; end; OnNPCKillEvent: if ( .monster_hunt_id == 0 || killedrid != .monster_hunt_id ) end; if ( hunter_points >= 1000 && @display_message == 0 ) message strcharinfo(0), "you can exceed 1000 hunters points (you have " + hunter_points + " hunters points)"; else if ( hunter_points < 1000 ) { hunter_points++; if ( @display_message == 0 ) message strcharinfo(0), "you have now " + hunter_points + " hunters points for killing a " + getmonsterinfo( .monster_hunt_id,0 ); } end; } 1 Quote
Capuche Posted May 17, 2014 Posted May 17, 2014 maybe like this - script atcmd_monsterhunt -1,{ OnInit: bindatcmd "monsterhunt",strnpcinfo(3)+"::OnCmd"; end; OnCmd: if ( .monster_hunt_id == 0 && ( .@atcmd_numparameters == 0 || .@atcmd_parameters$[0] == "on" || .@atcmd_parameters$[0] == "off" ) ) dispbottom "there is none monster to hunt"; else if ( .@atcmd_numparameters == 0 ) dispbottom "the new monster to hunt is " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ")"; else if ( .@atcmd_parameters$[0] == "on" ) { if ( @display_message == 0 ) dispbottom "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") already display a message"; else { dispbottom "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") will display a message"; @display_message = 0; } } else if ( .@atcmd_parameters$[0] == "off" ) { if ( @display_message == 1 ) dispbottom "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") already don't display a message"; else { dispbottom "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") won't display a message"; @display_message = 1; } } else if ( getgmlevel() >= 25 ) { if ( .@atcmd_parameters$[0] == "0" ) { dispbottom "you stop the hunt"; .monster_hunt_id = 0; } else { .@mob_name$ = getmonsterinfo( atoi(.@atcmd_parameters$[0]),0 ); if ( .@mob_name$ == "null" ) dispbottom "wrong mob id"; else { .monster_hunt_id = atoi(.@atcmd_parameters$[0]); dispbottom "the new monster to hunt is "+ .@mob_name$ + " (ID: " + .monster_hunt_id + ")"; } } } else dispbottom "@" + .@atcmd_command$ + " failed. @" + .@atcmd_command$ + " to display the mob to hunt. @" + .@atcmd_command$ + " on/off to display a message killing the mob"; end; OnNPCKillEvent: if ( .monster_hunt_id == 0 || killedrid != .monster_hunt_id ) end; if ( hunter_points >= 1000 && @display_message == 0 ) message strcharinfo(0), "you can exceed 1000 hunters points (you have " + hunter_points + " hunters points)"; else if ( hunter_points < 1000 ) { if ( @display_message == 0 ) message strcharinfo(0), "you have now " + hunter_points + " hunters points for killing a " + getmonsterinfo( .monster_hunt_id,0 ); hunter_points++; } end; } players : - @monsterhunt : display the monster to hunt - @monsterhunt on/off : display a message or not when killing the mob gm : - @monsterhunt 0 : stop the hunt - @monsterhunt <mob_id> : mob to hunt - @monsterhunt : display the monster to hunt - @monsterhunt on/off : display a message or not when killing the mob Quote
Unknown Posted May 18, 2014 Posted May 18, 2014 It's awesome! But when I kill a determined monster for the first time, the script says "You now have 0 hunter points" when it should say 1. Any idea why? >< Quote
Capuche Posted May 18, 2014 Posted May 18, 2014 My mistake Increment the hunt point before display the message else if ( hunter_points < 1000 ) { + hunter_points++; if ( @display_message == 0 ) message strcharinfo(0), "you have now " + hunter_points + " hunters points for killing a " + getmonsterinfo( .monster_hunt_id,0 ); - hunter_points++; } Quote
EL Dragon Posted May 18, 2014 Posted May 18, 2014 You can make a Show Npc , whether the event on or off and the mob the points give ? Quote
Unknown Posted May 19, 2014 Posted May 19, 2014 only if you have some free time... is it possible to limit a character to have 1000 points per day only? (Instead of limiting the points for each character)SSorry for asking that much q-q Quote
Erba Posted May 19, 2014 Author Posted May 19, 2014 prontera,150,180,5 script Hunter monster 87,{ end; OnEvent: waitingroom "Mob to hunt: "+ getmonsterinfo( getvariableofnpc( .monster_hunt_id,"atcmd_monsterhunt" ),0 ) + " (ID: " + getvariableofnpc( .monster_hunt_id,"atcmd_monsterhunt" ) + ")",0; } - script atcmd_monsterhunt -1,{ OnInit: bindatcmd "monsterhunt",strnpcinfo(3)+"::OnCmd"; end; OnCmd: if ( .monster_hunt_id == 0 && ( .@atcmd_numparameters == 0 || .@atcmd_parameters$[0] == "on" || .@atcmd_parameters$[0] == "off" ) ) dispbottom "there is none monster to hunt"; else if ( .@atcmd_numparameters == 0 ) dispbottom "the new monster to hunt is " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ")"; else if ( .@atcmd_parameters$[0] == "on" ) { if ( @display_message == 0 ) dispbottom "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") already display a message"; else { dispbottom "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") will display a message"; @display_message = 0; } } else if ( .@atcmd_parameters$[0] == "off" ) { if ( @display_message == 1 ) dispbottom "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") already don't display a message"; else { dispbottom "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") won't display a message"; @display_message = 1; } } else if ( getgmlevel() >= 25 ) { if ( .@atcmd_parameters$[0] == "0" ) { dispbottom "you stop the hunt"; .monster_hunt_id = 0; delwaitingroom "Hunter monster"; } else { .@mob_name$ = getmonsterinfo( atoi(.@atcmd_parameters$[0]),0 ); if ( .@mob_name$ == "null" ) dispbottom "wrong mob id"; else { .monster_hunt_id = atoi(.@atcmd_parameters$[0]); dispbottom "the new monster to hunt is "+ .@mob_name$ + " (ID: " + .monster_hunt_id + ")"; donpcevent "Hunter monster::OnEvent"; } } } else dispbottom "@" + .@atcmd_command$ + " failed. @" + .@atcmd_command$ + " to display the mob to hunt. @" + .@atcmd_command$ + " on/off to display a message killing the mob"; end; OnNPCKillEvent: if ( .monster_hunt_id == 0 || killedrid != .monster_hunt_id ) end; if ( hunter_points >= 1000 && @display_message == 0 ) message strcharinfo(0), "you can exceed 1000 hunters points (you have " + hunter_points + " hunters points)"; else if ( hunter_points < 1000 ) { hunter_points++; if ( @display_message == 0 ) message strcharinfo(0), "you have now " + hunter_points + " hunters points for killing a " + getmonsterinfo( .monster_hunt_id,0 ); } end; } thank you sir.. im gonna try this one^^ btw, how can i make the points to be use in a shop? Quote
EL Dragon Posted May 19, 2014 Posted May 19, 2014 test it - shop Emistry_Shop -1,512:100 // -------------------------------------------------- fire_event,25,40,4 script Event Shop#1 111,{ function ShopSettings; function ValidateCost; function CurrencyInfo; function ClearData; function ValueConvert; function ErrorNotice; OnInit: waitingroom "Hunt Shop",0; mes "Each Shop from the Menu may purchase using ^FF0000Different Currency^000000."; mes "^00FF00____________________________^000000"; mes "So,Which shop you would like to look at it"; next; select("Headgear","Foods","Cossumber"); ClearData(); ShopSettings( @menu ); npcshopitem "Emistry_Shop",512,100; npcshopdelitem "Emistry_Shop",512; for(set .@i,0; .@i < getarraysize( @ItemLists ); set .@i,.@i+1) npcshopadditem "Emistry_Shop",@ItemLists[.@i],@ItemCost[.@i]; mes "Okay...wait awhile"; mes "^00FF00____________________________^000000"; CurrencyInfo( @Currency$ ); mes "^00FF00____________________________^000000"; callshop "Emistry_Shop",1; npcshopattach "Emistry_Shop"; end; function ShopSettings { switch( getarg(0) ){ Case 1: // Currency [ Item ID / Variable Name ] set @Currency$,"hunter_points"; // Item ID Lists setarray @ItemLists[0],5377,5288,5146,5269,5376,5235,5236,5237,5289,5306,5322,5366; // ITEM ID // Item Price setarray @ItemCost[0],200,220,150,400,450,250,250,250,200,250,230,300; // ITEM COST/AMOUNT break; Case 2: // Currency [ Item ID / Variable Name ] set @Currency$,"hunter_points"; // Item ID Lists setarray @ItemLists[0],1815; // Item Price setarray @ItemCost[0],100; break; Case 3: // Currency [ Item ID / Variable Name ] set @Currency$,"hunter_points"; // Item ID Lists setarray @ItemLists[0],2776,12260,14037; // Item Price setarray @ItemCost[0],500,50,30; break; // Case 4,5,6.....etc... default: ErrorNotice( "Invalid Menu Selection for Menu "+@menu+"." ); close; } if( @Currency$ == "" ) ErrorNotice( "Invalid Currency Setting in Menu "+@menu+" ." ); if( getarraysize( @ItemCost ) != getarraysize( @ItemLists ) || getarraysize( @ItemLists ) != getarraysize( @ItemCost ) ) ErrorNotice( "Missing or Extra Value of Item or Cost Settings in Menu "+@menu+" ." ); return; } function ErrorNotice { mes "^FF0000ERROR^000000 - "+getarg(0); mes "^00FF00____________________________^000000"; mes "Inform this Message to ^0000FFGame Staffs^000000 immediately !"; close; } function CurrencyInfo { if( getitemname( atoi( getarg(0) ) ) != "null" ){ mes "Item Currency : ^FF0000"+getitemname( atoi( getarg(0) ) )+"^000000"; mes "Available Amount : ^0000FF"+ValueConvert( countitem( atoi( getarg(0) ) ) )+"^000000"; }else if( getitemname( atoi( getarg(0) ) ) == "null" ){ mes "Variable Currency : ^FF0000"+getarg(0)+"^000000"; mes "Available Amount : ^0000FF"+ValueConvert( getd( getarg(0) ) )+"^000000"; } return; } function ValidateCost { if( getitemname( atoi( getarg(0) ) ) != "null" ){ if( countitem( atoi( getarg(0) ) ) < getarg(1) ) return 1; }else{ if( getd( getarg(0) ) < getarg(1) ) return 1; } return 0; } function ClearData { set @Currency$,""; set @TotalCost,0; deletearray @bought_nameid[0],getarraysize( @bought_nameid ); deletearray @bought_quantity[0],getarraysize( @bought_quantity ); deletearray @ItemLists[0],getarraysize( @ItemLists ); deletearray @ItemCost[0],getarraysize( @ItemCost ); return; } function ValueConvert { set .@num, atoi(""+getarg(0)); if ( .@num == 0 || .@num >= 2147483647 ) return getarg(0); set .@l, getstrlen(""+.@num); for ( set .@i,0; .@i < .@l; set .@i, .@i + 1 ) { set .@num$, .@num % pow(10,.@i+1) / pow(10,.@i) + .@num$; if ( (.@i+1) % 3 == 0 && .@i+1 != .@l ) set .@num$, ","+ .@num$; } return .@num$; } OnBuyItem: ShopSettings( @menu ); for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1) for(set @j,0; @j < getarraysize( @ItemLists ); set @j,@j+1) if( @ItemLists[@j] == @bought_nameid[@i] ) set @TotalCost,@TotalCost + ( @ItemCost[@j] * @bought_quantity[@i] ); mes "^FF0000 BILLING LIST^000000"; mes "^00FF00____________________________^000000"; for( set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1 ) mes "^FF0000"+@bought_quantity[@i]+" x ^0000FF"+getitemname( @bought_nameid[@i] )+"^000000"; mes "^00FF00____________________________^000000"; if( getitemname( atoi( @Currency$ ) ) != "null" ) mes "Total Cost : ^0000FF"+ValueConvert( @TotalCost )+" x "+getitemname( atoi( @Currency$ ) )+"^000000"; else if( getitemname( atoi( @Currency$ ) ) == "null" ){ mes "Total Cost : ^0000FF"+ValueConvert( @TotalCost )+" "+@Currency$+"^000000"; } mes "^00FF00____________________________^000000"; if( ValidateCost( @Currency$,@TotalCost ) ){ if( getitemname( atoi( @Currency$ ) ) != "null" ) mes "[ ^FF0000X^000000 ] Insufficient ^0000FF"+getitemname( atoi( @Currency$ ) )+"^000000"; else{ mes "[ ^FF0000X^000000 ] Insufficient ^0000FF"+@Currency$+"^000000"; } }else{ if( select( "^0000FFPurchase^000000:Cancel" ) == 1 ){ if( getitemname( atoi( @Currency$ ) ) != "null" ) delitem atoi( @Currency$ ),@TotalCost; else{ set getd( @Currency$ ),getd( @Currency$ ) - @TotalCost; } for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1) getitem @bought_nameid[@i],@bought_quantity[@i]; message strcharinfo(0),"Purchased "+getarraysize( @bought_nameid )+" Items."; mes "Thank you for shopping."; } } ClearData(); close; } 1 Quote
Capuche Posted May 19, 2014 Posted May 19, 2014 only if you have some free time... is it possible to limit a character to have 1000 points per day only? (Instead of limiting the points for each character)S Sorry for asking that much q-q prontera,150,180,5 script Hunter monster 87,{ end; OnEvent: waitingroom "Mob to hunt: "+ getmonsterinfo( getvariableofnpc( .monster_hunt_id,"atcmd_monsterhunt" ),0 ) + " (ID: " + getvariableofnpc( .monster_hunt_id,"atcmd_monsterhunt" ) + ")",0; } - script atcmd_monsterhunt -1,{ OnInit: bindatcmd "monsterhunt",strnpcinfo(3)+"::OnCmd"; end; OnCmd: if ( .monster_hunt_id == 0 && ( .@atcmd_numparameters == 0 || .@atcmd_parameters$[0] == "on" || .@atcmd_parameters$[0] == "off" ) ) message strcharinfo(0), "there is none monster to hunt"; else if ( .@atcmd_numparameters == 0 ) message strcharinfo(0), "the new monster to hunt is " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ")"; else if ( .@atcmd_parameters$[0] == "on" ) { if ( @display_message == 0 ) message strcharinfo(0), "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") already display a message"; else { message strcharinfo(0), "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") will display a message"; @display_message = 0; } } else if ( .@atcmd_parameters$[0] == "off" ) { if ( @display_message == 1 ) message strcharinfo(0), "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") already don't display a message"; else { message strcharinfo(0), "killing a " + getmonsterinfo( .monster_hunt_id,0 ) + " (ID: " + .monster_hunt_id + ") won't display a message"; @display_message = 1; } } else if ( getgmlevel() >= 25 ) { if ( .@atcmd_parameters$[0] == "0" ) { message strcharinfo(0), "you stop the hunt"; .monster_hunt_id = 0; delwaitingroom "Hunter monster"; } else { .@mob_name$ = getmonsterinfo( atoi(.@atcmd_parameters$[0]),0 ); if ( .@mob_name$ == "null" ) { message strcharinfo(0), "wrong mob id\n"+ "-> " + .@atcmd_command$ + " to display the mob to hunt.\n"+ "-> " + .@atcmd_command$ + " on/off to display a message killing the mob\n"+ "-> " + .@atcmd_command$ + " 0 to stop the hunt\n"+ "-> " + .@atcmd_command$ + " <mob_id> to hunt the mob\n"; } else { .monster_hunt_id = atoi(.@atcmd_parameters$[0]); message strcharinfo(0), "the new monster to hunt is "+ .@mob_name$ + " (ID: " + .monster_hunt_id + ")"; donpcevent "Hunter monster::OnEvent"; } } } else message strcharinfo(0), .@atcmd_command$ + " failed. " + .@atcmd_command$ + " to display the mob to hunt. " + .@atcmd_command$ + " on/off to display a message killing the mob"; end; OnNPCKillEvent: if ( killedrid != .monster_hunt_id ) end; if ( ( hunter_points_today >> 10 ) % pow(2,10) == gettime(8) ) { if ( hunter_points_today % pow(2,10) < 1000 ) hunter_points_today++; else { if ( @display_message == 0 ) message strcharinfo(0), "you can exceed 1000 hunters points today (" + ( hunter_points_today % pow(2,10) ) + "/1000). Total: " + hunter_points + " hunters points."; end; } } else hunter_points_today = ( gettime(8) << 10 ) + 1; hunter_points++; if ( @display_message == 0 ) message strcharinfo(0), "you have now " + ( hunter_points_today % pow(2,10) ) + "/1000 points for killing a " + getmonsterinfo( .monster_hunt_id,0 ) + ". Total: " + hunter_points + " hunters points"; end; } Quote
Unknown Posted May 19, 2014 Posted May 19, 2014 (edited) oh! thank you very much, however when i use @monsterhunt off, the message is till displayed ><my bad ! Edited May 20, 2014 by Unknown Quote
Question
Erba
Requesting a script that requires a player to kill monsters in any maps they wanted..
every time they kill a monster(specified by a gm) they obtain 1 hunting point and only a maximum of 1000 hunting points to be obtain per character
GM automated:
@monsterhunt
a gm lvl 25 can change the Monster to be killed inorder to obtain poring point
11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.