Jump to content
  • 0

Goblin Invasion help


Mr BrycE

Question


  • Group:  Members
  • Topic Count:  125
  • Topics Per Day:  0.03
  • Content Count:  595
  • Reputation:   23
  • Joined:  02/23/12
  • Last Seen:  

hi, its from Mysterious

i thought that everything is fine, but i try checking if the Goblin Count is Sync to the Monster alive, but its not changing and after all the goblin are killed the boss is not spawning

//===== eAthena/rAthena Script ======================================= 
//= Goblin Invasion
//===== By: ================================================== 
//= Mysterious
//===== Current Version: ===================================== 
//= 1.5
//===== Compatible With: ===================================== 
//= eAthena or rAthena SVN 
//===== Description: ========================================= 
// Goblins spawn randomly in a given town. Once all Goblins are killed
// the Goblin Leader spawns.
//===== TODO: ================================================
// - Change more coding
//===== Additional Comments: =================================
//= v1.0 - First release [Mysterious]
//= v1.1 - Fixed Bugs [Mysterious]
//= v1.2 - Fixed Sentence structures [Mysterious]
//= v1.3 - Added Proper Notes [Mysterious]
//= v1.4 - Made it obvious on what players have to change [Mysterious]
//= v1.5 - Proper Sentence Structures and Typos fixed [Mysterious]
//============================================================ 

xxx,xxx,xxx,xxx    script    Goblin Invasion  459,{

set .gm,40;//GM Level to access the GM Menu. Default: 40

   // GM menu | Game Masters Level 40 or more are allowed to Start and Stop invasions.
   if (getgmlevel()>.gm) {
       if (.mobs_left) {
           mes "[invasion]";
           mes "An invasion is already in progress! Details:";
           mes "Location: " + .Map$;
           mes "^FF0000"+.mobs_left+"^000000 Goblins left";
           mes " ";
           mes "Would you like to Stop the invasion?";
           if(select("- No:- Yes")==1) close;
           donpcevent "Invasion NPC::OnTimer1805000";
           mes "Invasion stopped";
           announce "The Invasion has been stopped by "+strcharinfo(0),bc_all;
           close;
       }
       mes "[invasion]";
       mes "Please customize the Invasion event before starting it.";
       mes "Note - The Goblin Leader drops x5 of the prize.";
       Main:
       next;
       mes "[invasion]";
           switch(select("Item [" + getitemname(.ItemID) + "]:Start Event")) {
       case 1:
           mes "Which item would you like the Goblin Leader to drop?";
           mes "Please input the item ID:";
           input .ItemID;
           goto Main;
       case 2:
           mes "The event is going to begin shortly.";
           close2;
           goto OnStart;
   }

   //If a player clicks the NPC, the NPC will tell the player how much Mobs are left on the certain map.
   mes "[invasion]";
   mes "There are "+.mobs_left+" Goblins who've invaded "+.Map$[.rand_map]+"!";
   close;

           /////////////////////////
           //The actual NPC Script//
           /////////////////////////
OnMinute50: // Change this to your liking (When you want the event to start)
OnStart:
   set .mobs_left, 1;
   sleep2 1000;
   set $@ran, rand(1,6);
   if ($@ran == 6) set .Map$,"splendide";
   if ($@ran == 5) set .Map$,"izlude";
   if ($@ran == 4) set .Map$,"payon";
   if ($@ran == 3) set .Map$,"geffen";
   if ($@ran == 2) set .Map$,"morocc";
   if ($@ran == 1) set .Map$,"prontera";
   sleep2 1000;
   announce "[ Rune-Midgard Guard ]: We have trouble here in the fabulous town known as " + .Map$ + "!", bc_all;
   sleep2 5000;
   announce "[ Rune-Midgard Guard ]: Everyone, we need your help to get rid of these Goblins!", bc_all;
   monster .Map$,0,0,"Goblin",1258,250,"Invasion NPC::OnMyMobDead";
   set .mobs_left, 250;
   end;


OnTimer1805000:    // 30 minutes later, kills all the mobs.
   killmonster .Map$,"Invasion NPC::OnMyMobDead";
   set .mobs_left, 0;

OnStop://When the event is stopped by a GM, or all monsters dead.
   killmonster .Map$,"Invasion NPC::OnMyMobDead";
   killmonster .Map$,"Invasion NPC::OnSpecialMobDead";
   announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all;
   end;

OnMyMobDead: //When a Goblin is killed
   set .mobs_left, .mobs_left-1;
   if (.mobs_left==0) {
       announce "[ Rune-Midgard Guard ]: The Goblin Leader has spawned in " + .Map$ + "!", bc_all;
       monster .Map$,0,0,"Goblin Leader",1299,1,"Invasion NPC::OnSpecialMobDead";

   } else {
       announce "["+.mobs_left+"/250] Goblins left.",bc_map;
   }
   end;

OnSpecialMobDead:
       announce strcharinfo(0)+" has fought off the Goblin Invasion and has been awarded a worthy prize!", bc_all;
       getitem .ItemID,5; //Change the [5] to the amount you wish to hand out.
       donpcevent "Invasion NPC::OnStop";
   }
   end;

}

Edited by Mr BrycE
Link to comment
Share on other sites

22 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

What are the errors you're getting? Anything?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  125
  • Topics Per Day:  0.03
  • Content Count:  595
  • Reputation:   23
  • Joined:  02/23/12
  • Last Seen:  

no errors in my test server,and i tried to reload it on my server and no errros found, but still the counts doesnt change and the boss monster doesnt spawn

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

1) There is no "initnpctimer"/"stopnpctimer" so don't know why it use this name for label on your npc (it's not the cause of your problem).

2) All event (when you kill a goblin) are refered to the npc "Invasion NPC", your npc is "Goblin Invasion". Change the npc name or all events in the script to matches.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  125
  • Topics Per Day:  0.03
  • Content Count:  595
  • Reputation:   23
  • Joined:  02/23/12
  • Last Seen:  

thanks, hmmm how to add more items?xD

bump

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

Whoa, I don't know why it was at Invasion NPC =.='! Wtfux. Thanks guys.

thanks, hmmm how to add more items?xD

bump

OnSpecialMobDead:
 announce strcharinfo(0)+" has fought off the Goblin Invasion and has been awarded a worthy prize!", bc_all;
 getitem .ItemID,5; //Change the [5] to the amount you wish to hand out.
 donpcevent "Goblin Invasion::OnStop";
}

Add more 'getitem <itemID>,<AMOUNT>; under the existing getitem.

That should of fixed it now: http://mysterious-project.googlecode.com/svn/trunk/npc/GoblinInvasion.txt

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  125
  • Topics Per Day:  0.03
  • Content Count:  595
  • Reputation:   23
  • Joined:  02/23/12
  • Last Seen:  

one more thing....the mobs is sometimes not auto @killmonster when 30mins has passed, sooo, the counts are going like this...

-1/100

-2/100

-3/100

-4/100

but its no big deal...i think i can manage that, thank you sirs!

Edited by Mr BrycE
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  4
  • Reputation:   0
  • Joined:  05/22/12
  • Last Seen:  

one more thing....the mobs is sometimes not auto @killmonster when 30mins has passed, sooo, the counts are going like this...

-1/100

-2/100

-3/100

-4/100

but its no big deal...i think i can manage that, thank you sirs!

What was your solution? I'm having the same problem. The mobs aren't actually being wiped from the map even when the event is cancelled.

Edited by REDRUM
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  125
  • Topics Per Day:  0.03
  • Content Count:  595
  • Reputation:   23
  • Joined:  02/23/12
  • Last Seen:  

Actually im still having the same problem and dont have solution for it

Mysterious

can fix it

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  172
  • Reputation:   0
  • Joined:  07/07/12
  • Last Seen:  

bump! same problem

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  172
  • Reputation:   0
  • Joined:  07/07/12
  • Last Seen:  

already! still error!

one more thing....the mobs is sometimes not auto @killmonster when 30mins has passed, sooo, the counts are going like this...

-1/100

-2/100

-3/100

-4/100

This event need to add data (mob_db ... ) to server ?

Edited by zhaosin
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

already! still error!

one more thing....the mobs is sometimes not auto @killmonster when 30mins has passed, sooo, the counts are going like this...

-1/100

-2/100

-3/100

-4/100

This event need to add data (mob_db ... ) to server ?

Post your version of the script please. And no, you don't need to add any additional information.

Anyways.. I think I got a lot more tweaking to do with that script.. o_o

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  172
  • Reputation:   0
  • Joined:  07/07/12
  • Last Seen:  

//===== rAthena Script =======================================
//= Goblin Invasion
//===== By: ==================================================
//= Mysterious
//===== Current Version: =====================================
//= 1.6
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
// Goblins spawn randomly in a given town. Once all Goblins are killed
// the Goblin Leader spawns.
//===== TODO: ================================================
// - Change more coding
//===== Additional Comments: =================================
//= v1.0 - First release [Mysterious]
//= v1.1 - Fixed Bugs [Mysterious]
//= v1.2 - Fixed Sentence structures [Mysterious]
//= v1.3 - Added Proper Notes [Mysterious]
//= v1.4 - Made it obvious on what players have to change [Mysterious]
//= v1.5 - Proper Sentence Structures and Typos fixed [Mysterious]
//= v1.6 - Fixed mobs not counting down properly [Mysterious]
//============================================================

mellina,123,78,4	script	Goblin Invasion	459,{

set .gm,40;//GM Level to access the GM Menu. Default: 40

// GM menu | Game Masters Level 40 or more are allowed to Start and Stop invasions.
if (getgmlevel()>.gm) {
	if (.mobs_left) {
		mes "[invasion]";
		mes "An invasion is already in progress! Details:";
		mes "Location: " + .Map$;
		mes "^FF0000"+.mobs_left+"^000000 Goblins left";
		mes " ";
		mes "Would you like to Stop the invasion?";
		if(select("- No:- Yes")==1) close;
		donpcevent "Invasion NPC::OnTimer1805000";
		mes "Invasion stopped";
		announce "The Invasion has been stopped by "+strcharinfo(0),bc_all;
		close;
	}
	mes "[invasion]";
	mes "Please customize the Invasion event before starting it.";
	mes "Note - The Goblin Leader drops x5 of the prize.";
	Main:
	next;
	mes "[invasion]";
		switch(select("Item [" + getitemname(.ItemID) + "]:Start Event")) {
	case 1:
		mes "Which item would you like the Goblin Leader to drop?";
		mes "Please input the item ID:";
		input .ItemID;
		goto Main;
	case 2:
		mes "The event is going to begin shortly.";
		close2;
		goto OnStart;
}

//If a player clicks the NPC, the NPC will tell the player how much Mobs are left on the certain map.
mes "[invasion]";
mes "Còn "+.mobs_left+" 5 chú Goblins đang long nhong tại "+.Map$[.rand_map]+"!";
close;

		/////////////////////////
		//The actual NPC Script//
		/////////////////////////
OnMinute50: // Change this to your liking (When you want the event to start)
OnStart:
set .mobs_left, 1;
sleep2 1000;
set $@ran, rand(1,5);
if ($@ran == 5) set .Map$,"izlude";
if ($@ran == 4) set .Map$,"payon";
if ($@ran == 3) set .Map$,"geffen";
if ($@ran == 2) set .Map$,"morocc";
if ($@ran == 1) set .Map$,"prontera";
sleep2 1000;
announce "[ Rune-Midgard Guard ]: Ơ kìa, lũ Goblin đang phá làng phá xóm ở " + .Map$ + "!", bc_all;
sleep2 5000;
announce "[ Rune-Midgard Guard ]: Mọi người ơi, hãy đuổi bọn choi choi này giúp chúng mình với!!", bc_all;
monster .Map$,0,0,"Goblin",1258,250,"Goblin Invasion::OnMyMobDead";
set .mobs_left, 250;
end;


OnTimer1805000:	// 30 minutes later, kills all the mobs.
killmonster .Map$,"Goblin Invasion::OnMyMobDead";
set .mobs_left, 0;

OnStop://When the event is stopped by a GM, or all monsters dead.
killmonster .Map$,"Goblin Invasion::OnMyMobDead";
killmonster .Map$,"Goblin Invasion::OnSpecialMobDead";
announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all;
end;

OnMyMobDead: //When a Goblin is killed
set .mobs_left, .mobs_left-1;
if (.mobs_left==0) {
	announce "[ Rune-Midgard Guard ]: Golbin Bé Bự đã xuất hiện tại " + .Map$ + "!", bc_all;
	monster .Map$,0,0,"Goblin Leader",1299,1,"Goblin Invasion::OnSpecialMobDead";

} else {
	announce "Còn ["+.mobs_left+"/250] chú Goblins.",bc_map;
}
end;

OnSpecialMobDead:
	announce strcharinfo(0)+" đã đá trúng mông Golbin Bé Bự, cả nhà vỗ tay hoan hô nào!", bc_all;
	getitem .ItemID,10; //Change the [5] to the amount you wish to hand out.
	donpcevent "Goblin Invasion::OnStop";
}
end;

}

This!

Edited by Mysterious
Use codebox for content longer than 10 lines
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

Under unstart, change

set.mobs_left,1;

to 0 or delete it. Check both to see what works. You have this part here

donpcevent "Invasion NPC::OnTimer1805000";

make sure its Goblin Invasion

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  172
  • Reputation:   0
  • Joined:  07/07/12
  • Last Seen:  

Can you help me fix my script and post here ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

//===== rAthena Script =======================================
//= Goblin Invasion
//===== By: ==================================================
//= Mysterious
//===== Current Version: =====================================
//= 1.6
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
// Goblins spawn randomly in a given town. Once all Goblins are killed
// the Goblin Leader spawns.
//===== TODO: ================================================
// - Change more coding
//===== Additional Comments: =================================
//= v1.0 - First release [Mysterious]
//= v1.1 - Fixed Bugs [Mysterious]
//= v1.2 - Fixed Sentence structures [Mysterious]
//= v1.3 - Added Proper Notes [Mysterious]
//= v1.4 - Made it obvious on what players have to change [Mysterious]
//= v1.5 - Proper Sentence Structures and Typos fixed [Mysterious]
//= v1.6 - Fixed mobs not counting down properly [Mysterious]
//============================================================

mellina,123,78,4    script    Goblin Invasion    459,{

set .gm,40;//GM Level to access the GM Menu. Default: 40

   // GM menu | Game Masters Level 40 or more are allowed to Start and Stop invasions.
   if (getgmlevel()>.gm) {
       if (.mobs_left) {
           mes "[invasion]";
           mes "An invasion is already in progress! Details:";
           mes "Location: " + .Map$;
           mes "^FF0000"+.mobs_left+"^000000 Goblins left";
           mes " ";
           mes "Would you like to Stop the invasion?";
           if(select("- No:- Yes")==1) close;
           donpcevent "Goblin Invasion::OnTimer1805000";
           mes "Invasion stopped";
           announce "The Invasion has been stopped by "+strcharinfo(0),bc_all;
           close;
       }
       mes "[invasion]";
       mes "Please customize the Invasion event before starting it.";
       mes "Note - The Goblin Leader drops x5 of the prize.";
       Main:
       next;
       mes "[invasion]";
           switch(select("Item [" + getitemname(.ItemID) + "]:Start Event")) {
       case 1:
           mes "Which item would you like the Goblin Leader to drop?";
           mes "Please input the item ID:";
           input .ItemID;
           goto Main;
       case 2:
           mes "The event is going to begin shortly.";
           close2;
           goto onstart;
   }

   //If a player clicks the NPC, the NPC will tell the player how much Mobs are left on the certain map.
   mes "[invasion]";
   mes "Còn "+.mobs_left+" 5 chú Goblins đang long nhong tại "+.Map$[.rand_map]+"!";
   close;

           /////////////////////////
           //The actual NPC Script//
           /////////////////////////
OnMinute50: // Change this to your liking (When you want the event to start)
onstart:
   set .mobs_left, 0;
   sleep2 1000;
   set $@ran, rand(1,5);
   if ($@ran == 5) set .Map$,"izlude";
   if ($@ran == 4) set .Map$,"payon";
   if ($@ran == 3) set .Map$,"geffen";
   if ($@ran == 2) set .Map$,"morocc";
   if ($@ran == 1) set .Map$,"prontera";
   sleep2 1000;
   announce "[ Rune-Midgard Guard ]: Ơ kìa, lũ Goblin đang phá làng phá xóm ở " + .Map$ + "!", bc_all;
   sleep2 5000;
   announce "[ Rune-Midgard Guard ]: Mọi người ơi, hãy đuổi bọn choi choi này giúp chúng mình với!!", bc_all;
   monster .Map$,0,0,"Goblin",1258,250,"Goblin Invasion::OnMyMobDead";
   set .mobs_left, 250;
   end;


OnTimer1805000:    // 30 minutes later, kills all the mobs.
   killmonster .Map$,"Goblin Invasion::OnMyMobDead";
   set .mobs_left, 0;

onstop://When the event is stopped by a GM, or all monsters dead.
   killmonster .Map$,"Goblin Invasion::OnMyMobDead";
   killmonster .Map$,"Goblin Invasion::OnSpecialMobDead";
   announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all;
   end;

OnMyMobDead: //When a Goblin is killed
   set .mobs_left,.mobs_left - 1;
   if (.mobs_left==0) {
       announce "[ Rune-Midgard Guard ]: Golbin Bé Bự đã xuất hiện tại " + .Map$ + "!", bc_all;
       monster .Map$,0,0,"Goblin Leader",1299,1,"Goblin Invasion::OnSpecialMobDead";

   } else {
       announce "Còn ["+.mobs_left+"/250] chú Goblins.",bc_map;
   }
   end;

OnSpecialMobDead:
       announce strcharinfo(0)+" đã đá trúng mông Golbin Bé Bự, cả nhà vỗ tay hoan hô nào!", bc_all;
       getitem .ItemID,10; //Change the [5] to the amount you wish to hand out.
       donpcevent "Goblin Invasion::onstop";
   }
   end;

}

See if this works.

If what I did here doesn't work:

OnMinute50: // Change this to your liking (When you want the event to start)
onstart:
   set .mobs_left, 0;

Remove the set .mobs_left, 0; part.

Literally 1am for me T.T I'm probably missing a lot of things..

Edited by Mysterious
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

2) All event (when you kill a goblin) are refered to the npc "Invasion NPC", your npc is "Goblin Invasion". Change the npc name or all events in the script to matches.

have to quote this

change

donpcevent "Invasion NPC::OnTimer1805000";

into

donpcevent "Goblin Invasion::OnTimer1805000";

but I guessed you guys already fixed this


[Error]: script_rid2sd: fatal error ! player not attached!
[Debug]: Function: strcharinfo (1 parameter):
[Debug]: Data: number value=0
[Debug]: Source (NPC): Goblin Invasion at prontera (151,189)

problem from here

   donpcevent "Invasion NPC::OnTimer1805000";
.....
OnTimer1805000:	// 30 minutes later, kills all the mobs.
killmonster .Map$,"Goblin Invasion::OnMyMobDead";
set .mobs_left, 0;

OnStop://When the event is stopped by a GM, or all monsters dead.
killmonster .Map$,"Goblin Invasion::OnMyMobDead";
killmonster .Map$,"Goblin Invasion::OnSpecialMobDead";
announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all;
end;

if gm wants to stop the event

the script execute donpcevent , and this doesn't bring the RID

and where is initnpctimer ?

EDIT:

seems like I repeated the same thing as Keyworld said =x

EDIT2:

the reason it can go into -1/250 because there's no initnpctimer to execute the OnTimerxxx label

so if previous map has left over mobs, it will never trigger OnTimerxxxx label to execute killmonster command

example:

if previous round in geffen it doesn't clean up completely ( this script doesn't has initnpctimer )

when a new event start in izlude, set .mob, 250;

geffen still has 100 mobs, and izlude has the new 250 mobs

it can deduct into -100 if players kill mobs from geffen and izlude ( 250 -250-100 )

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

2) All event (when you kill a goblin) are refered to the npc "Invasion NPC", your npc is "Goblin Invasion". Change the npc name or all events in the script to matches.

have to quote this

change

donpcevent "Invasion NPC::OnTimer1805000";

into

donpcevent "Goblin Invasion::OnTimer1805000";

but I guessed you guys already fixed this


[Error]: script_rid2sd: fatal error ! player not attached!
[Debug]: Function: strcharinfo (1 parameter):
[Debug]: Data: number value=0
[Debug]: Source (NPC): Goblin Invasion at prontera (151,189)

problem from here

 donpcevent "Invasion NPC::OnTimer1805000";
.....
OnTimer1805000: // 30 minutes later, kills all the mobs.
killmonster .Map$,"Goblin Invasion::OnMyMobDead";
set .mobs_left, 0;
OnStop://When the event is stopped by a GM, or all monsters dead.
killmonster .Map$,"Goblin Invasion::OnMyMobDead";
killmonster .Map$,"Goblin Invasion::OnSpecialMobDead";
announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all;
end;

if gm wants to stop the event

the script execute donpcevent , and this doesn't bring the RID

and where is initnpctimer ?

LOL! That's why! Ga dur. Okay, lets do this. No wonder.. I was trying to attach a non appearing timer on people.. Hmph.

See if this works now.

//===== rAthena Script =======================================
//= Goblin Invasion
//===== By: ==================================================
//= Mysterious
//===== Current Version: =====================================
//= 1.6
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
// Goblins spawn randomly in a given town. Once all Goblins are killed
// the Goblin Leader spawns.
//===== TODO: ================================================
// - Change more coding
//===== Additional Comments: =================================
//= v1.0 - First release [Mysterious]
//= v1.1 - Fixed Bugs [Mysterious]
//= v1.2 - Fixed Sentence structures [Mysterious]
//= v1.3 - Added Proper Notes [Mysterious]
//= v1.4 - Made it obvious on what players have to change [Mysterious]
//= v1.5 - Proper Sentence Structures and Typos fixed [Mysterious]
//= v1.6 - Fixed mobs not counting down properly [Mysterious]
//============================================================

xxx,xxx,xxx,xxx    script    Goblin Invasion  459,{

set .gm,40;//GM Level to access the GM Menu. Default: 40

   // GM menu | Game Masters Level 40 or more are allowed to Start and Stop invasions.
   if (getgmlevel()>.gm) {
       if (.mobs_left) {
           mes "[invasion]";
           mes "An invasion is already in progress! Details:";
           mes "Location: " + .Map$;
           mes "^FF0000"+.mobs_left+"^000000 Goblins left";
           mes " ";
           mes "Would you like to Stop the invasion?";
           if(select("- No:- Yes")==1) close;
           mes "Invasion stopped";
           announce "The Invasion has been stopped by "+strcharinfo(0),bc_all;
           goto OnStop;
       }
       mes "[invasion]";
       mes "Please customize the Invasion event before starting it.";
       mes "Note - The Goblin Leader drops x5 of the prize.";
       Main:
       next;
       mes "[invasion]";
           switch(select("Item [" + getitemname(.ItemID) + "]:Start Event")) {
       case 1:
           mes "Which item would you like the Goblin Leader to drop?";
           mes "Please input the item ID:";
           input .ItemID;
           goto Main;
       case 2:
           mes "The event is going to begin shortly.";
           close2;
           goto OnStart;
   }

   //If a player clicks the NPC, the NPC will tell the player how much Mobs are left on the certain map.
   mes "[invasion]";
   mes "There are "+.mobs_left+" Goblins who've invaded "+.Map$[.rand_map]+"!";
   close;

           /////////////////////////
           //The actual NPC Script//
           /////////////////////////
OnMinute50: // Change this to your liking (When you want the event to start)
OnStart:
   set .mobs_left, 0;
   sleep2 1000;
   set $@ran, rand(1,6);
   if ($@ran == 6) set .Map$,"splendide";
   if ($@ran == 5) set .Map$,"izlude";
   if ($@ran == 4) set .Map$,"payon";
   if ($@ran == 3) set .Map$,"geffen";
   if ($@ran == 2) set .Map$,"morocc";
   if ($@ran == 1) set .Map$,"prontera";
   sleep2 1000;
   announce "[ Rune-Midgard Guard ]: We have trouble here in the fabulous town known as " + .Map$ + "!", bc_all;
   sleep2 5000;
   announce "[ Rune-Midgard Guard ]: Everyone, we need your help to get rid of these Goblins!", bc_all;
   monster .Map$,0,0,"Goblin",1258,250,"Goblin Invasion::OnMyMobDead";
   set .mobs_left, 250;
   end;

OnStop://When the event is stopped by a GM, or all monsters dead.
   killmonster .Map$,"Goblin Invasion::OnMyMobDead";
   killmonster .Map$,"Goblin Invasion::OnSpecialMobDead";
   announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all;
   end;

OnMyMobDead: //When a Goblin is killed
   set .mobs_left,.mobs_left - 1;
   if (.mobs_left==0) {
       announce "[ Rune-Midgard Guard ]: The Goblin Leader has spawned in " + .Map$ + "!", bc_all;
       monster .Map$,0,0,"Goblin Leader",1299,1,"Goblin Invasion::OnSpecialMobDead";

   } else {
       announce "["+.mobs_left+"/250] Goblins left.",bc_map;
   }
   end;

OnSpecialMobDead:
       announce strcharinfo(0)+" has fought off the Goblin Invasion and has been awarded a worthy prize!", bc_all;
       getitem .ItemID,5; //Change the [5] to the amount you wish to hand out.
       donpcevent "Goblin Invasion::OnStop";
   }
   end;

}

Rofl. Making a faulty timer.... a whoops. If that still doesn't fix it.. I think I need to go to bed.

Edited by Mysterious
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  172
  • Reputation:   0
  • Joined:  07/07/12
  • Last Seen:  

Can you update new ver to 1.7 fixed all ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

Can you update new ver to 1.7 fixed all ?

What I posted above, did that fix your issues first? So that I can change it in my SVN.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  172
  • Reputation:   0
  • Joined:  07/07/12
  • Last Seen:  

Please update your SVN and i will update it again :-?

Edited by zhaosin
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  181
  • Reputation:   33
  • Joined:  11/11/12
  • Last Seen:  

I would like to help.

I would edit the Goblin Invasion NPC:

so I can choose:

which the item, MVP, will give - ok

which Mob will be summoned - i need ( just summom goblins i need to choose )

which MVP will be summoned - i need ( just summom goblin leader i need to choose )

which Map the event will begin - i need ( its randon i need to choose )

and be able to program the weekdays and the hours of the event ( i will be happy )

"same as the NPC WOE"

if anyone can help i'm greatful

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...