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 :
Secondly, search for :
Thirdly, add this UNDER it then Save :
Fourthly, Open NPCs.h then search for :
Fifthly, add this UNDER it :
DONE~!
Example of how to Script NPCs to Kill All Mobs :
I ENTIRELY figured out this by myself.
Credits to Me.
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"
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);
}
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]);
}
}
Code:
void teleport(int mapid);
Code:
void killMobs();
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();
}
}
Credits to Me.
Last edited: