ok i recently added the transformation mask for tormented demons and for the dagannoth mother found it very useful instead of spawning different ids repeatedly
Note i know there was one released but his was t2ing and i thought that people should have this mask
First open up your npc class
and add these
Code:
public boolean transformUpdateRequired = false;
public int transformId;
Code:
public void requestTransform(int Id) {
transformId = Id;
transformUpdateRequired = true;
updateRequired = true;
}
Code:
public void appendTransformUpdate(Stream str) {
str.writeWordBigEndianA(transformId);
}
now replace your
Code:
public void appendNPCUpdateBlock(Stream str) {
with
Code:
public void appendNPCUpdateBlock(Stream str) {
if(!updateRequired) return ;
int updateMask = 0;
if(animUpdateRequired) updateMask |= 0x10;
if(hitUpdateRequired2) updateMask |= 8;
if(mask80update) updateMask |= 0x80;
if(dirUpdateRequired) updateMask |= 0x20;
if(forcedChatRequired) updateMask |= 1;
if(hitUpdateRequired) updateMask |= 0x40;
if (transformUpdateRequired) updateMask |= 2;
if(FocusPointX != -1) updateMask |= 4;
str.writeByte(updateMask);
if (animUpdateRequired) appendAnimUpdate(str);
if (hitUpdateRequired2) appendHitUpdate2(str);
if (mask80update) appendMask80Update(str);
if (dirUpdateRequired) appendFaceEntity(str);
if(forcedChatRequired) {
str.writeString(forcedText);
}
if (hitUpdateRequired) appendHitUpdate(str);
if (transformUpdateRequired) appendTransformUpdate(str);
if(FocusPointX != -1) appendSetFocusDestination(str);
}
and replace this
Code:
public void clearUpdateFlags() {
updateRequired = false;
forcedChatRequired = false;
hitUpdateRequired = false;
hitUpdateRequired2 = false;
animUpdateRequired = false;
dirUpdateRequired = false;
transformUpdateRequired = false;
mask80update = false;
forcedText = null;
moveX = 0;
moveY = 0;
direction = -1;
FocusPointX = -1;
FocusPointY = -1;
}
how it would be used?
NPCHandler.npcs[i].requestTransform(NPCID HERE);
examples of npcs that could be used for this
- Tormented demons
- Dagannoth Mother
- any other npc that changes