on("ready", function() { var getCleanImgsrc = function (imgsrc) { var parts = imgsrc.match(/(.*\/images\/.*)(thumb|med|original|max)([^\?]*)(\?[^?]+)?$/); if(parts) { return parts[1]+'thumb'+parts[3]+(parts[4]?parts[4]:`?${Math.round(Math.random()*9999999)}`); } return; }; on("chat:message", function (msg) { // Make sure to copy your druid character's name exactly in CharacterGet parameter. if (msg.type === "api" && msg.content === "!DSBaseChar") { CharacterGet('Morthos', msg, 'Normal', 0); } if (msg.type === "api" && msg.content === "!DSApe") { CharacterGet('Druid Ape', msg, 'Normal', 0); } if (msg.type === "api" && msg.content === "!DSAxeBeak") { CharacterGet('Druid Axe Beak', msg, 'Large', 60); } if (msg.type === "api" && msg.content === "!DSBrownBear") { CharacterGet('Druid Brown Bear', msg, 'Large', 60); } if (msg.type === "api" && msg.content === "!DSCrocodile") { CharacterGet('Druid Crocodile', msg, 'Large', 60); } if (msg.type === "api" && msg.content === "!DSDireWolf") { CharacterGet('Druid Dire Wolf', msg, 'Large', 60); } if (msg.type === "api" && msg.content === "!DSGiantBadger") { CharacterGet('Druid Giant Badger', msg, 'Normal', 0); } if (msg.type === "api" && msg.content === "!DSGiantCentipede") { CharacterGet('Druid Giant Centipede', msg, 'Normal', 0); } if (msg.type === "api" && msg.content === "!DSGiantEagle") { CharacterGet('Druid Giant Eagle', msg, 'Large', 60); } if (msg.type === "api" && msg.content === "!DSGiantGoat") { CharacterGet('Druid Giant Goat', msg, 'Large', 60); } if (msg.type === "api" && msg.content === "!DSGiantHyena") { CharacterGet('Druid Giant Hyena', msg, 'Large', 60); } if (msg.type === "api" && msg.content === "!DSGiantOctopus") { CharacterGet('Druid Giant Octopus', msg, 'Large', 60); } if (msg.type === "api" && msg.content === "!DSGiantSeaHorse") { CharacterGet('Druid Giant Sea Horse', msg, 'Large', 60); } if (msg.type === "api" && msg.content === "!DSGiantSpider") { CharacterGet('Druid Giant Spider', msg, 'Large', 60); } if (msg.type === "api" && msg.content === "!DSGiantWolfSpider") { CharacterGet('Druid Giant Wolf Spider', msg, 'Large', 60); } if (msg.type === "api" && msg.content === "!DSGiantPoisonousSnake") { CharacterGet('Druid Giant Poisonous Snake', msg, 'Normal', 0); } if (msg.type === "api" && msg.content === "!DSGiantToad") { CharacterGet('Druid Giant Toad', msg, 'Large', 30); } if (msg.type === "api" && msg.content === "!DSPanther") { CharacterGet('Druid Panther', msg, 'Normal', 60); } if (msg.type === "api" && msg.content === "!DSReefShark") { CharacterGet('Druid Reef Shark', msg, 'Large', 30); } if (msg.type === "api" && msg.content === "!DSWarhorse") { CharacterGet('Druid Warhorse', msg, 'Large', 30); } if (msg.type === "api" && msg.content === "!DSGiantVulture") { CharacterGet('Druid Giant Vulture', msg, 'Large', 30); } if (msg.type === "api" && msg.content === "!DSTiger") { CharacterGet('Druid Tiger', msg, 'Large', 60); } if (msg.type === "api" && msg.content === "!DSLion") { CharacterGet('Druid Lion', msg, 'Large', 60); } }); function Size(charSize, msg) { if (charSize === "Normal"){ _.each(msg.selected,function (o) { getObj(o._type,o._id).set("height", 70); getObj(o._type,o._id).set("width", 70); });} if (charSize === "Large"){ _.each(msg.selected,function (o) { getObj(o._type,o._id).set("height", 140); getObj(o._type,o._id).set("width", 140); });} if (charSize === "Huge"){ _.each(msg.selected,function (o) { getObj(o._type,o._id).set("height", 210); getObj(o._type,o._id).set("width", 210); });} if (charSize === "Gargantuan"){ _.each(msg.selected,function (o) { getObj(o._type,o._id).set("height", 280); getObj(o._type,o._id).set("width", 280); });} } function CharacterGet(characterName, msg, charSize, darkvision) { var ShiftCharacter = findObjs({ type: 'character', name: characterName })[0]; //sendChat("", "ShiftChar is: " + ShiftCharacter.get('name')); if(getAttrByName(ShiftCharacter.get('id'), 'npc', 'current') == 1) { //sendChat("", "NPC thing happened"); _.each(msg.selected,function (o) { getObj(o._type,o._id).set({ imgsrc: getCleanImgsrc(ShiftCharacter.get('avatar')), bar1_link: 'None', represents: ShiftCharacter.id, bar1_value: getAttrByName(ShiftCharacter.get('id'), 'hp', 'max'), bar1_max: getAttrByName(ShiftCharacter.get('id'), 'hp', 'max'), bar3_value: getAttrByName(ShiftCharacter.get('id'), 'npc_ac', 'current'), bar3_current: getAttrByName(ShiftCharacter.get('id'), 'npc_ac', 'current'), light_radius: darkvision, light_dimradius: 0, light_otherplayers: false }); }); } else { //sendChat("", "PC thing happened"); _.each(msg.selected,function (o) { getObj(o._type,o._id).set({ imgsrc: getCleanImgsrc(ShiftCharacter.get('avatar')), represents: ShiftCharacter.id, bar1_value: getAttrByName(ShiftCharacter.get('id'), "hp", 'current'), bar1_max: getAttrByName(ShiftCharacter.get('id'), "hp", 'max'), bar1_link: findObjs({type: "attribute", characterid: ShiftCharacter.get('id'), name: 'hp'})[0].id, bar3_value: getAttrByName(ShiftCharacter.get('id'), "ac", 'current'), bar3_current: getAttrByName(ShiftCharacter.get('id'), "ac", 'max'), bar3_max: getAttrByName(ShiftCharacter.get('id'), "ac", 'max'), bar3_link: findObjs({type: "attribute", characterid: ShiftCharacter.get('id'), name: 'ac'})[0].id, light_radius: darkvision, light_dimradius: 0, light_otherplayers: false }); }); } Size(charSize, msg); } }); This is what I am using right now it switches AC properly throughout the animal forms but it doesn't remember the druids AC when switching back. Any suggestions?