Jump to content
  • 0

[PAID]Custom Goblin Invasion NPC


Balmung

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   2
  • Joined:  11/08/12
  • Last Seen:  

Hello again everyone.

I am beginning to learn more about scripting, yet, I haven't quite reached the experience level of making this script. So I decided maybe some of you can help me.

I need a Custom Goblin Invasion NPC for EATHENA.

Here is everything that I would like it to have:

  • Automatically start every 2 hours (adjustable)

  • Spawns 3x the number of players online at that given time.

  • Each goblin has 50 HP

  • There should be 5 different types of goblins

  • ID 1122: Has a 100% chance to drop silver coin (ID:27004)
  • ID 1125: Has a 100% chance to drop gold coins (ID:27005)
  • ID 1308: Has a 100% chance to drop either Event Ticket (ID:27007) or Mysterious Hat Box (27003).
  • ID 1299: Has a 100% chance to drop 20 Silver Coins, 5 Gold Coins, 1 Event Ticket, 1 Mysterious Hat Box
  • ID 1122 (2): Drops nothing (same sprite as 1122)

  • Goblin 1122 should be about 70% of the goblins spawned

  • Goblin 1122 (2) should be about 10% of the goblins spawned

  • Goblin 1125 should be about 20% of the goblins spawned

  • Goblin 1308 three should be spawned every time

  • Goblin 1299 only one spawns BUT not every invasion (if possible) Also needs to have like 5k HP and extremely high defense (player only hits 1's)

  • The player who kills the last goblin, no matter what type it is will always get 1 event ticket.

The goblins need to invade either Amatsu, Prontera, Alberta, or Payon. It needs to broadcast to the server how many and what map the invasion has begun on. It also needs to broadcast to the server when only 10 goblins are left and who killed the last goblin.

On the map of the invasion, it needs to broadcast how many goblins are left by the 100's, until it gets to 50. Then it counts down how many goblins are left by ones. This broadcast should only be on that specific map.

This script needs to be fully editable in the fact that if I wanted to change drops, HP, maps, broadcasts, ect ect I could do so.

If I have left out any important information please do not hesitate to ask. It's very important that this script is flawless and works up to my expectations. Thanks!

In addition, each goblin killed earns you points that you can use at a Goblin Point NPC for items and such. The lesser goblins should be less points and the more "rarer" goblins should have a few more points. The goblin leader should give 100.

Edited by Balmung
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Holy crap man. Thank you so much!

You're welcome lol

I did say paid, so would you give me your paypal email so i can send you some money?

It's a gift ;)

Just tested it. for some reason, it spawned 4 goblin leaders.

Yeah I did some mistake here a little revision.

mob_db2.txt

2302,GOBLIN_LEADER,Goblin Leader,Goblin Leader,64,5000,0,6036,2184,1,663,752,99,99,5,55,37,30,69,58,10,12,1,7,24,0x3695,120,1120,620,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

prontera,155,180,5	script	Goblin Invasion	456,{
if( !.count && .shop ) {
	mes "Exchange Goblins points ?";
	if( select( "Yes", "No" ) -1 )
		if( getgmlevel() < 1 ) close;
		else goto L_event;
// Use Euphy's quest_shop
// ----------------------
	callfunc "qshop", 1;
}
else if( getgmlevel() < 1 ) close;

// GM can Start / Stop Event
// -------------------------
L_event:
mes ( .count ? "Stop" : "Start" ) +" Goblin Invasion ?";
if( select( "Yes", "No" ) -1 ) close;
if( .count ) goto L_stop;

OnHour00:
OnHour02:
initnpctimer;
set .Leader, ( rand( 1,100 ) <= .mob_option5[ 1 ] ? 1 : 0 );
set .num, getusers(1) * 3;
set .count, .num + 3 + .Leader;

set .map$, .map_event$[ rand( getarraysize( .map_event$ ) ) ];

announce .count +" Goblins invade "+ setchar( .map$, strtoupper( charat( .map$, 0 ) ), 0 ) +" citie !", 0;

for( set .@i, 1; .@i <= 3; set .@i, .@i + 1 ) {
	set .@a, ( .@i == 3 ? .num - .@b : ( getd( ".mob_option"+ .@i +"[ 1 ]" ) * .num ) / 100 );
	monster .map$,0,0,"--ja--", getd( ".mob_option"+ .@i +"[ 0 ]" ), .@a, strnpcinfo(0) +"::OnKillGob"+ .@i;
	set .@b, .@b + .@a;
}
monster .map$,0,0,"--ja--", .mob_option4, 3, strnpcinfo(0) +"::OnKillGob4";
if( .Leader )
	monster .map$,0,0,"--ja--", .mob_option5, 1, strnpcinfo(0) +"::OnKillGob5";
close;


OnKillGob1:
callsub S_getitem, 1;// 1 : just a post-it
OnKillGob2:
callsub S_getitem, 2;
OnKillGob3:
callsub S_getitem, 3;
OnKillGob4:
callsub S_getitem, 4;
OnKillGob5:
callsub S_getitem, 5;

S_getitem:
set .count, .count - 1;
// Rewards : 1/ Points
// -------------------
set .@p, getd( ".mob_option"+ getarg(0) +"[ 2 ]" );
set #Goblin_points, #Goblin_points + .@p;
dispbottom "You get "+ .@p +" point"+ ( .@p > 1 ? "s" : "" ) +".";
// 2/ Items
// --------
for( set .@i, 3; .@i < getarraysize( getd( ".mob_option"+ getarg(0) ) ); set .@i, .@i + 2 )
	getitem getd( ".mob_option"+ getarg(0) +"[ "+ .@i +" ]" ), getd( ".mob_option"+ getarg(0) +"[ "+ ( .@i+1 ) +" ]" );
// Broadcast
// ---------
switch( .count ) {
	case 10:
		announce .count +" Goblins left.", 0;
		break;
	case 0:
		announce strcharinfo(0) +" kill the last Goblin !", 0;
		getitem 27007, 1;
		break;
	// Count down how many goblins are left : if = 100 then broadcast, broadcast by ones if Goblins <= 50
	default:
		if( .count < 100 && .count > 50 || .count > 100 ) end;
		mapannounce .map$, .count +" Goblins left.", 0;
}
end;

OnTimer1800000:// Automatically stop invasion 30 min later
L_stop:
stopnpctimer;
set .count, 0;
killmonsterall .map$;
announce ( playerattached() ? strcharinfo(0) +" : " : "" ) +"Event Goblins invasions is finished !", 0;
close;

OnInit:
// Leave this alone
for( set .@i, 1; .@i <= 5; set .@i, .@i + 1 )
	deletearray getd( ".mob_option"+ .@i );
deletearray .map_event$;

// Index : MobID, Spawn rate (70/100), Points reward, ID reward 1, Number reward 1, ID reward 2, Number reward 2, etc...
setarray .mob_option1, 2300, 70, 1, 27004, 1;	
setarray .mob_option2, 2300, 10, 7;									// = Mob ID 1122(2)
setarray .mob_option3, 2301, 20, 3, 27005, 1;						// = Mob ID 1125

// Fix 3 spawn every time / change '3' in < monster .map$,0,0,"--ja--", .mob_option4, 3, strnpcinfo(0) +"::OnKillGob4"; > to change this number
setarray .mob_option4, 2303, 100, 1, 27003, 1, 27007, 1;

// Goblin Leader / Index : MobID, chance spawn (5/100) PER EVENT, Points reward, ID reward 1, Number reward 1, ID reward 2, Number reward 2, etc...
setarray .mob_option5, 2302, 5, 1, 675, 20, 671, 5, 27003, 1, 27007, 1;

// Map Invasion
// ------------
setarray .map_event$, "amatsu", "prontera", "alberta", "payon";

// Enable Shop ? 1 / 0 : ( yes / no )
// ----------------------------------
set .shop, 0;

end;
}

Edited by Capuche
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

db/mob_avail.txt

2300,1122,0
2301,1125,0
2302,1299,0
2303,1308,0

db/mob_db2.txt

2300,GOBLIN_1,Goblin,Goblin,25,50,0,310,188,1,118,140,10,5,1,53,25,20,38,10,10,12,1,7,24,0x3695,100,1120,620,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2301,GOBLIN_4,Goblin,Goblin,23,50,0,264,164,1,109,131,10,5,1,23,46,15,36,10,10,12,1,7,22,0x308D,200,1624,624,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2302,GOBLIN_LEADER,Goblin Leader,Goblin Leader,64,5000,0,6036,2184,1,663,752,48,16,5,55,37,30,69,58,10,12,1,7,24,0x3735,120,1120,620,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2303,PANZER_GOBLIN,Panzer Goblin,Panzer Goblin,59,50,0,7212,2697,1,683,878,41,28,60,60,40,20,81,160,10,12,1,7,44,0x3695,200,960,1008,840,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

db/mob_skill_db2.txt


2300,Goblin@NPC_EMOTION,chase,197,1,2000,0,5000,yes,self,always,0,18,,,,,,
2300,Goblin@NPC_EMOTION,chase,197,1,200,0,5000,yes,self,always,0,19,0x81,,,,,
2300,Goblin@NPC_EMOTION,idle,197,1,2000,0,5000,yes,self,always,0,2,0x3695,,,,,
2300,Goblin@NPC_WINDATTACK,attack,187,2,500,500,5000,no,target,always,0,,,,,,,

2301,Goblin@NPC_EMOTION,chase,197,1,2000,0,5000,yes,self,always,0,20,,,,,,
2301,Goblin@NPC_GROUNDATTACK,attack,185,2,500,500,5000,no,target,always,0,,,,,,,
2301,Goblin@NPC_EMOTION,chase,197,1,200,0,5000,yes,self,always,0,19,0x81,,,,,
2301,Goblin@NPC_EMOTION,idle,197,1,2000,0,5000,yes,self,always,0,2,0x308D,,,,,

2302,Goblin Leader@AL_TELEPORT,idle,26,1,10000,0,0,yes,self,rudeattacked,,,,,,,,
2302,Goblin Leader@BS_MAXIMIZE,attack,114,5,500,1000,5000,no,self,always,0,,,,,,27,
2302,Goblin Leader@BS_MAXIMIZE,chase,114,5,500,1000,5000,no,self,always,0,,,,,,27,
2302,Goblin Leader@CR_SHIELDCHARGE,attack,250,3,500,0,5000,no,target,always,0,,,,,,27,
2302,Goblin Leader@NPC_SUMMONSLAVE,attack,196,5,10000,2000,60000,no,self,slavele,2,2300,1123,1124,2301,1126,27,
2302,Goblin Leader@NPC_SUMMONSLAVE,idle,196,5,10000,2000,60000,no,self,slavele,2,2300,1123,1124,2301,1126,27,

2303,Panzer Goblin@NPC_SELFDESTRUCTION,attack,173,1,500,2000,5000,no,self,myhpltmaxrate,50,,,,,,23,
2303,Panzer Goblin@NPC_WINDATTACK,attack,187,1,2000,0,5000,yes,target,always,0,,,,,,,
2303,Panzer Goblin@SM_MAGNUM,attack,7,9,500,500,5000,no,self,always,0,,,,,,6,

NPC

prontera,155,180,5	script	Goblin Invasion	456,{
if( getgmlevel() < 1 && !.count ) {
	mes "Exchange Goblins points ?";
	if( select( "Yes", "No" ) -1 ) close;
// Use Euphy's quest_shop
// ----------------------
	callfunc "qshop", 1;
}
else if( getgmlevel() < 1 ) close;

// GM can Start / Stop Event
// -------------------------
mes ( .count ? "Stop" : "Start" ) +" Goblin Invasion ?";
if( select( "Yes", "No" ) -1 ) close;
if( .count ) goto L_stop;

OnHour00:
OnHour02:
L_invade:
initnpctimer;
set .Leader, ( rand( 1,100 ) <= .mob_option5[ 1 ] ? 1 : 0 );
set .num, getusers(1) * 3;
set .count, .num + 3 + .Leader;

set .map$, .map_event$[ rand( getarraysize( .map_event$ ) ) ];

announce .count +" Goblins invade "+ setchar( .map$, strtoupper( charat( .map$, 0 ) ), 0 ) +" citie !", 0;

for( set .@i, 1; .@i <= 3; set .@i, .@i + 1 ) {
	set .@a, ( .@i == 3 ? .num - .@b : ( getd( ".mob_option"+ .@i +"[ 1 ]" ) * .num ) / 100 );
	monster .map$,0,0,"--ja--", getd( ".mob_option"+ .@i +"[ 0 ]" ), .@a, strnpcinfo(3) +"::OnKillGob"+ .@i;
	set .@b, .@b + .@a;
}
monster .map$,0,0,"--ja--", .mob_option4, 3, strnpcinfo(3) +"::OnKillGob4";
if( .Leader )
	monster .map$,0,0,"--ja--", .mob_option5, 1, strnpcinfo(3) +"::OnKillGob5";
close;


OnKillGob1:
callsub S_getitem, 1;// 1 : just a post-it
OnKillGob2:
callsub S_getitem, 2;
OnKillGob3:
callsub S_getitem, 3;
OnKillGob4:
callsub S_getitem, 4;
OnKillGob5:
callsub S_getitem, 5;

S_getitem:
set .count, .count - 1;
// Rewards : 1/ Points
// -------------------
set .@p, getd( ".mob_option"+ getarg(0) +"[ 2 ]" );
set #Goblin_points, #Goblin_points + .@p;
dispbottom "You get "+ .@p +" point"+ ( .@p > 1 ? "s" : "" ) +".";
// 2/ Items
// --------
for( set .@i, 3; .@i < getarraysize( getd( ".mob_option"+ getarg(0) ) ); set .@i, .@i + 2 )
	getitem getd( ".mob_option"+ getarg(0) +"[ "+ .@i +" ]" ), getd( ".mob_option"+ getarg(0) +"[ "+ ( .@i+1 ) +" ]" );
// Broadcast
// ---------
switch( .count ) {
	case 10:
		announce .count +" Goblins left.", 0;
		break;
	case 0:
		announce strcharinfo(0) +" kill the last Goblin !", 0;
		getitem 27007, 1;
		break;
	// Count down how many goblins are left : if = 100 then broadcast, broadcast by ones if Goblins <= 50
	default:
		if( .count < 100 && .count > 50 || .count > 100 ) end;
		mapannounce .map$, .count +" Goblins left.", 0;
}
end;

OnTimer1800000:// Automatically stop invasion 30 min later
L_stop:
set .count, 0;
killmonsterall .map$;
announce strcharinfo(0) +" stop Event Goblins invasions !", 0;
close;

OnInit:
// Leave this alone
for( set .@i, 1; .@i <= 5; set .@i, .@i + 1 )
	deletearray getd( ".mob_option"+ .@i );
deletearray .map_event$;

// Index : MobID, Spawn rate (70/100), Points reward, ID reward 1, Number reward 1, ID reward 2, Number reward 2, etc...
setarray .mob_option1, 2300, 70, 1, 27004, 1;	
setarray .mob_option2, 2300, 10, 7;									// = Mob ID 1122(2)
setarray .mob_option3, 2301, 20, 3, 27005, 1;						// = Mob ID 1125

// Fix 3 spawn every time / change '3' in < monster .map$,0,0,"--ja--", .mob_option4, 3, strnpcinfo(3) +"::OnKillGob4"; > to change this number
setarray .mob_option4, 2302, 100, 1, 27003, 1, 27007, 1;

// Goblin Leader / Index : MobID, chance spawn (5/100) PER EVENT, Points reward, ID reward 1, Number reward 1, ID reward 2, Number reward 2, etc...
setarray .mob_option5, 2303, 5, 100, 675, 20, 671, 5, 27003, 1, 27007, 1;

// Map Invasion
// ------------
setarray .map_event$, "amatsu", "prontera", "alberta", "payon";
end;
}

You can add some time to automatically start the event after

OnHour00:
OnHour02:

02 : at 2h

04 : at 4h etc..

Here mobs options

// Index : MobID, Spawn rate (70/100), Points reward, ID reward 1, Number reward 1, ID reward 2, Number reward 2, etc...
setarray .mob_option1, 2300, 70, 1, 27004, 1;	
setarray .mob_option2, 2300, 10, 7;									// = Mob ID 1122(2)
setarray .mob_option3, 2301, 20, 3, 27005, 1;						// = Mob ID 1125

// Fix 3 spawn every time / change '3' in < monster .map$,0,0,"--ja--", .mob_option4, 3, strnpcinfo(3) +"::OnKillGob4"; > to change this number
setarray .mob_option4, 2302, 100, 1, 27003, 1, 27007, 1;

// Goblin Leader / Index : MobID, chance spawn (5/100) PER EVENT, Points reward, ID reward 1, Number reward 1, ID reward 2, Number reward 2, etc...
setarray .mob_option5, 2303, 5, 100, 675, 20, 671, 5, 27003, 1, 27007, 1;

Here maps options

// Map Invasion
// ------------
setarray .map_event$, "amatsu", "prontera", "alberta", "payon";

GM can start / stop the event otherwise the event can start automatically.

It spawns 1 Goblin leader (5% chance per event by default) + 3 * players online + 3 fix

Option shop : call Euphy's quest shop 1 (so you must include his script).

Maybe it's not very easy to understand this script >'>

Edited by Capuche
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   2
  • Joined:  11/08/12
  • Last Seen:  

Holy crap man. Thank you so much!

I did say paid, so would you give me your paypal email so i can send you some money?

Just tested it. for some reason, it spawned 4 goblin leaders.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   2
  • Joined:  11/08/12
  • Last Seen:  

ah thanks. ill test it now

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...