do you want them to speak when they spawn?
Ps i added so noone but the person who summoned can attack
use this to spawn them:
add this in npchandler
Code:
public void SpawnAndAttack(int npcType, int x, int y, int heightLevel, int rangex1, int rangey1, int rangex2, int rangey2, int WalkingType, int HP, boolean Respawns, int summonedBy) {
// first, search for a free slot
int slot = -1;
for (int i = 1; i < maxNPCs; i++) {
if (npcs[i] == null) {
slot = i;
break;
}
}
if(slot == -1) return; // no free slot found
if(HP <= 0) { // This will cause client crashes if we don't use this :) - ****
HP = 3000;
}
NPC newNPC = new NPC(slot, npcType);
newNPC.absX = x;
newNPC.absY = y;
newNPC.makeX = x;
newNPC.makeY = y;
newNPC.moverangeX1 = rangex1;
newNPC.moverangeY1 = rangey1;
newNPC.moverangeX2 = rangex2;
newNPC.moverangeY2 = rangey2;
newNPC.walkingType = WalkingType;
newNPC.HP = HP;
newNPC.MaxHP = HP;
newNPC.MaxHit = (int)Math.floor((HP / 100));
if (newNPC.MaxHit < 1) {
newNPC.MaxHit = 1;
}
if(npcType >= 2025 && npcType <= 2030){
newNPC.textUpdate = "You dare disturb my rest!";
newNPC.textUpdateRequired = true;
newNPC.barrowsPlayer = summonedBy;
}
newNPC.heightLevel = heightLevel;
newNPC.Respawns = Respawns;
newNPC.followPlayer = summonedBy;
newNPC.StartKilling = summonedBy;
newNPC.IsUnderAttack = true;
newNPC.followingPlayer = true;
client plr = (client) server.playerHandler.players[summonedBy];
npcs[slot] = newNPC;
}
add this in NPC.java
Code:
public int barrowsPlayer;
open client.java and find:
Now in there find:
Code:
attacknpc = inStream.readUnsignedWordA();
under that add:
Code:
int NPCID = server.npcHandler.npcs[attacknpc].npcType;
if(NPCID >= 2025 && NPCID <= 2030){
if(server.npcHandler.npcs[attacknpc].barrowsPlayer != playerId){
sM(GetNpcName(NPCID)+" isn't interested in Attacking you.");
break;
}
}