Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

NPCs Kills All Mobs in Map

Status
Not open for further replies.
Newbie Spellweaver
Joined
Apr 16, 2008
Messages
11
Reaction score
0
Not really sure if this had been released yet, but I managed to figure out how to make NPCs kill All Mobs in the Map.

Im using TitanMS ver009b
SHOULD work on other TitanMS Revs too!

This will kill ALL Mobs in the MAP that the NPC is in.
This will probablly be only used for PQ NPCs.

Hope I helped by contributing this.

Files to be Edited: NPCs.cpp & NPCs.h

Firstly, Open & add this to the top of NPCs.cpp, IF not already there :
Code:
#include "Mobs.h"
Secondly, search for :
Code:
void NPC::sendStyle(int styles[], char [B]size[/B]){
	[B]Packet[/B] [B]packet[/B] = npcPacket(7);
	packet.addByte(size);
	for(int i=0; i<size; i++)
		packet.addInt(styles[i]);
	packet.packetSend(player);
}
Thirdly, add this UNDER it then Save :
Code:
void NPC::killMobs(){
	int [B]size[/B]=Mobs::mobs[player->getMap()].size();
	for (int j=0; j<size; j++){
		Mobs::dieMob(player, Mobs::mobs[player->getMap()][0]);
	}
}
Fourthly, Open NPCs.h then search for :
Code:
void teleport(int mapid);
Fifthly, add this UNDER it :
Code:
void killMobs();
DONE~!

Example of how to Script NPCs to Kill All Mobs :
Code:
void NPCsScripts::npc_[I][B]NPC ID HERE[/B][/I](NPC* npc){
	int state = npc->getState();
	if(state == 0){
		npc->addText("I will now Kill All Mobs.");
		npc->sendOK();
		npc->end();
		npc->killMobs();
	}
}
I ENTIRELY figured out this by myself.
Credits to Me.
 
Last edited:
Newbie Spellweaver
Joined
Apr 9, 2008
Messages
60
Reaction score
0
Re: [Release] NPCs Kills All Mobs in Map

Nice work. Don't know how this could really be useful, but good job for the effort. :D
 
Newbie Spellweaver
Joined
Apr 16, 2008
Messages
11
Reaction score
0
Re: [Release] NPCs Kills All Mobs in Map

Nice work. Don't know how this could really be useful, but good job for the effort. :D
Like I said... probably will only be used for PQs like Pirate PQ, 2nd Stage
when Guon kills all mobs after collecting 20 pieces.
 
Status
Not open for further replies.
Back
Top