// Pet Cranius // by: Newominus // v1.0 // -Requires big head mode for boss kill victory chest animation and emotes // Place inside cosmetics folder and import with stonescript using "import Cosmetics/PetCranius" // Features Cranius the bone giant, ever faithful on your journey and happy to store all your acquisitions in his giant treasure chest! Features customisable chest and victory chest options. // Recommended to be disabled while participating in quests if you wish to see things. var skullColor //the color Cranius is var chestType //how the chest looks var chestColor //the color the chest is //CHOOSE YOUR CRANIUS COLOR--------------------------------< skullColor = #808080 //grey //CHOOSE YOUR CHEST---------------------------------------< //Replace with one below: bone | delta chestType = delta ?chestType = bone chestColor = #white :?chestType = delta chestColor = #rainbow var keepDistance = -50 // distance at which the movement animation will play (stateMoving) var maxX = -24 // closest offset pet will get to character. Closer to 0, closer to character var maxDistance = -70 // if the pet exceeds this distance, it will teleport to this distance (cannot be further away than this) var targetZ = 2 // We want to start the drawing 1 unit above the player agent ?loc.loop keepDistance = -50 maxX = -24 maxDistance = -70 targetZ = 2 var x = 0 var y = 0 var myX = 0 var myZ = 0 var lastPlayerX = 0 var lastPlayerZ = 0 var stateNone = 0 var stateIdle = 1 var stateMoving = 2 var currentState = stateNone var stateTime = 0 var chestTime = 0 func SetState(newState) ?newState = stateMoving play haunted_gate_shuffle //play sound when moving currentState = newState stateTime = 0 ?currentState = stateNone | time = 1 lastPlayerX = pos.x lastPlayerZ = pos.z myX = keepDistance myZ = targetZ // Start further away if skully is summoned while the location is already running ?time > 1 myX = maxDistance SetState(stateIdle) myX = myX - (pos.x - lastPlayerX) // If player has moved, increment myX (distance from player) stateTime++ ?face = "( ^^" & stateTime > 30 chestTime++ ?face ! "( ^^" chestTime = 0 ?currentState = stateIdle ?myX < maxDistance | myX > -maxDistance myX = maxDistance myZ = myZ - (pos.z - lastPlayerZ) ?myX < keepDistance SetState(stateMoving) :?currentState = stateMoving & chestTime = 0 ?myX < maxX myX++ ?stateTime >= 6 ?myZ > targetZ myZ-- :?myZ < targetZ myZ++ ?stateTime >= 12 SetState(stateIdle) lastPlayerX = pos.x lastPlayerZ = pos.z //DRAW state timers--------------------------------< //for debugging or whatever, uncomment if you want to see //>`0,7,StateTime = @stateTime@ //>`0,8,ChestTime = @chestTime@ //IDLE---------------------------------------------< ?currentState = stateIdle & face ! "( ^^" >o@myX@,@myZ-12@,@skullColor@,ascii # ###########_.-----._ ___///‾` #########.' '. '.| ########/ ___, __,\ |; #######| \ (_*) ,(_*);-----|. #######| ) _ /!) ) | | ########`.__,.) (' | . #######/ '. `'""'´/.______|. '. ######| \ \‾._____/ ;.._ `. | ######|. '-.__,''._.'####‾‾-____) ######\ '.___,''._.' #####.' \__\##/__/ ####[_.'#### asciiend >o@myX@,@myZ-12@,@chestColor@,ascii # #####################___ ###########################'. ############################| #######################-----| ############################| ############################| ######################______| asciiend >o@myX@,@myZ-12@,@skullColor@,ascii # # # # # # # ######( ) #######\ \ ########\ \ #########\ \ ##########\ "..______.-‾‾‾`. ###########(________;__,-\\\> asciiend //EYES----------------------------------------< ?currentState = stateIdle ?face = "°°" ?time % 10 = 0 & myX > keepDistance myX-- ?time % 4 <= 1 >o@myX@,@myZ-12@,@skullColor@,ascii # # # #############___, __, ############(_^) ,(_^) asciiend ?time % 4 > 1 >o@myX@,@myZ-12@,@skullColor@,ascii # # # #############___, __, ############(_^) ,(_^) asciiend //BLINKING---------------------------- ?face ! "( ^^" ?stateTime % 50 >= 48 >o@myX@,@myZ-12@,@skullColor@,ascii # # # #############___, __, ############(==) ,(==) asciiend :?stateTime % 50 >= 46 >o@myX@,@myZ-12@,@skullColor@,ascii # # # #############___, __, ############(--) ,(--) asciiend :?stateTime % 50 >= 44 >o@myX@,@myZ-12@,@skullColor@,ascii # # # #############___, __, ############(==) ,(==) asciiend //CHEST ANIMATION-----------------------------------------------< x = myX + 6 y = myZ + 4 ?face = "( ^^" ?chestTime <= 5 >o@myX@,@myZ-12@,@skullColor@,ascii # ###########_.-----._ ___///‾` #########.' '. '.| ########/ ___, __,\ |; #######| \ (_*) ,(_*);-----|. #######| ) _ /!) ) | | ########`.__,.) (' | . #######/ '. `'""'´/.______|. '. ######| \ \‾._____/ ;.._ `. | ######|. '-.__,''._.'####‾‾-____) ######\ '.___,''._.' #####.' \__\##/__/ ####[_.'#### asciiend >o@myX@,@myZ-12@,@chestColor@,ascii # #####################___ ###########################'. ############################| #######################-----| ############################| ############################| ######################______| asciiend >o@myX@,@myZ-12@,@skullColor@,ascii # # # # # # # ######( ) #######\ \ ########\ \ #########\ \##########_.'‾‾. ##########\ "..______. ‾, ###########(________(_____,/ asciiend //------------------------------- :?chestTime <= 10 >o@myX@,@myZ-12@,@skullColor@,ascii # ###########_.-----._ ___///‾` #########.' '. '.| ########/ ___, __,\ |; #######| \ (_*) ,(_*);-----|. #######| ) _ /!) ) | | ########`.__,.) (' | . #######/ '. `'""'´/.______|. '. ######| \ \‾._____/ ;.._ `. | ######|. '-.__,''._.'####‾‾-____) ######\ '.___,''._.' #####.' \__\##/__/ ####[_.'#### asciiend >o@myX@,@myZ-12@,@chestColor@,ascii # #####################___ ###########################'. ############################| #######################-----| ############################| ############################| ######################______| asciiend >o@myX@,@myZ-12@,@skullColor@,ascii # # # # # # # ######( ) #######\ \ ########\ \ #########\ \ ##########\ "..______.->####. ###########(________;____;// asciiend ?chestType = bone >o@myX@,@myZ-12@,@chestColor@,ascii # # # # # # # # # # ######################## ########################--- # asciiend :?chestType = delta >o@myX@,@myZ-12@,@chestColor@,ascii # # # # # # # # # # ######################## ########################--- # asciiend :?chestTime <= 45 >o@myX@,@myZ-12@,@skullColor@,ascii # ###########_.-----._ ___///‾` #########.' '. '.| ########/ ___, __,\ |; #######| \ (_*) ,(_*);-----|. #######| ) _ /!) ) | | ########`.__,.) (' | . #######/ '. `'""'´/.______|. '. ######| \ \‾._____/ ;.._ `. | ######|. '-.__,''._.'####‾‾-____) ######\ '.___,''._.' #####.' \__\##/__/ ####[_.'#### asciiend >o@myX@,@myZ-12@,@chestColor@,ascii # #####################___ ###########################'. ############################| #######################-----| ############################| ############################| ######################______| asciiend >o@myX@,@myZ-12@,@skullColor@,ascii # # # # # # # ######( ) #######\ \ ########\ \ #########\ \ ##########\ "..______.->####, ###########(________;____;// asciiend ?chestType = bone >o@myX@,@myZ-12@,@chestColor@,ascii # # # # # # # # # # ########################___ ########################=o=╪3 # asciiend ?chestType = delta >o@myX@,@myZ-12@,@chestColor@,ascii # # # # # # # # # # ########################___ ########################-∆-╡ # asciiend //------------------------------- :?chestTime <= 50 >o@myX@,@myZ-12@,@skullColor@,ascii # ###########_.-----._ ___///‾` #########.' '. '.| ########/ ___, __,\ |; #######| \ (_*) ,(_*);-----|. #######| ) _ /!) ) | | ########`.__,.) (' | . #######/ '. `'""'´/.______|. '. ######| \ \‾._____/ ;.._ `. | ######|. '-.__,''._.'####‾‾-____) ######\ '.___,''._.' #####.' \__\##/__/ ####[_.'#### asciiend >o@myX@,@myZ-12@,@chestColor@,ascii # #####################___ ###########################'. ############################| #######################-----| ############################| ############################| ######################______| asciiend >o@myX@,@myZ-12@,@skullColor@,ascii # # # # # # # ######( ) #######\ \ ########\ \ #########\ \##########_.'‾‾. ##########\ "..______. ‾, ###########(________(_____,/ asciiend //------------------------------- :?chestTime <= 60 | chestTime > 60 >o@myX@,@myZ-12@,@skullColor@,ascii # ###########_.-----._ ___///‾` #########.' '. '.| ########/ ___, __,\ |; #######| \ (_*) ,(_*);-----|. #######| ) _ /!) ) | | ########`.__,.) (' | . #######/ '. `'""'´/.______|. '. ######| \ \‾._____/ ;.._ `. | ######|. '-.__,''._.'####‾‾-____) ######\ '.___,''._.' #####.' \__\##/__/ ####[_.'#### asciiend >o@myX@,@myZ-12@,@chestColor@,ascii # #####################___ ###########################'. ############################| #######################-----| ############################| ############################| ######################______| asciiend >o@myX@,@myZ-12@,@skullColor@,ascii # # # # # # # ######( ) #######\ \ ########\ \ #########\ \ ##########\ "..______.-‾‾‾`. ###########(________;__,-\\\> asciiend //MOVING-------------------------------------------< ?currentState = stateMoving ?stateTime/2 = 0 >o@myX@,@myZ-12@,@skullColor@,ascii # ###########_.-----._ ___///‾` #########.' '. '.| ########/ ___, __,\ |; #######| \ (_*) ,(_*);-----|. #######| ) _ /!) ) | | ########`.__,.) (' | . #######/ '. `'""'´/.______|. '. ######| \ \‾._____/ ;.._ `. | ######|. '-.__,''._.'####‾‾-____) ######\ '.___,''._.' #####.' \__\##/__/ ####[_.'#### asciiend >o@myX@,@myZ-12@,@chestColor@,ascii # #####################___ ###########################'. ############################| #######################-----| ############################| ############################| ######################______| asciiend >o@myX@,@myZ-12@,@skullColor@,ascii # # # # # # # ######( ) #######\ \ ########\ \ #########\ \ ##########\ "..______.-‾‾‾`. ###########(________;__,-\\\> asciiend ?stateTime/2 = 1 >o@myX@,@myZ-12@,@skullColor@,ascii ###########_.-----._ __///‾` #########.' '. '.| ########/ ___, __,\ |; #######| \ (_*) ,(_*);----|. #######| ) _ /!) ) | | ########`.__,.) (' | . #######/ '. `'""'´/._____|. '. ######| \ \‾._____/ ;._ `. | ######|. '-.__,''._.'###‾‾-____) ######\ '.___,''._.' #####.' \__\##/__/ ####[_.'#### # asciiend >o@myX@,@myZ-12@,@chestColor@,ascii #####################__ ##########################'. ###########################| #######################----| ###########################| ###########################| ######################_____| asciiend >o@myX@,@myZ-12@,@skullColor@,ascii # # # # # # # ######( ) #######\ \ ########\ \ #########\ \ ##########\ "..______.-‾‾‾`. ###########(________;__,-///> asciiend ?stateTime/2 = 2 >o@myX@,@myZ-12@,@skullColor@,ascii ###########_.-----._ _///‾` #########.' '. '.| ########/ ___, __,\ |; #######| \ (_*) ,(_*);---|. #######| ) _ /!) ) | | ########`.__,.) (' | . #######/ '. `'""'´/.____|. '. ######| \ \‾._____/ ;_ `. | ######|. '-.__,''._.'##‾‾-____) ######\ '.___,''._.' #####.' \__\##/__/ ####[_.'#### # asciiend >o@myX@,@myZ-12@,@chestColor@,ascii #####################_ #########################'. ##########################| #######################---| ##########################| ##########################| ######################____| asciiend >o@myX@,@myZ-12@,@skullColor@,ascii # # # # # # ######( ) ######| ; ######| | ######| | ######" ' ######. \._______.-‾‾‾`. ######(________;__,-///> asciiend ?stateTime/2 = 3 >o@myX@,@myZ-12@,@skullColor@,ascii ###########_.-----._ _///‾` #########.' '. '.| ########/ ___, __,\ |; #######| \ (_*) ,(_*);---|. #######| ) _ /!) ) | | ########`.__,.) (' | . #######/ '. `'""'´/.____|. '. ######| \ \‾._____/ ;_ `. | ######|. '-.__,''._.'##‾‾-____) ######\ '.___,''._.' #####.' \__\##/__/ ####[_.'#### # asciiend >o@myX@,@myZ-12@,@chestColor@,ascii #####################_ #########################'. ##########################| #######################---| ##########################| ##########################| ######################____| asciiend >o@myX@,@myZ-12@,@skullColor@,ascii # # # # # # ######( ) ######| ; ######| | ######| | ######' ' #####; '_______.-‾‾‾`. ####(________;__,-///> asciiend ?stateTime/2 = 4 >o@myX@,@myZ-12@,@skullColor@,ascii ###########_.-----._ _///‾` #########.' '. '.| ########/ ___, __,\ |; #######| \ (_*) ,(_*);---|. #######| ) _ /!) ) | | ########`.__,.) (' | . #######/ '. `'""'´/.____|. '. ######| \ \‾._____/ ;_ `. | ######|. '-.__,''._.'##‾‾-____) ######\ '.___,''._.' #####.' \__\##/__/ ####[_.'#### # asciiend >o@myX@,@myZ-12@,@chestColor@,ascii #####################_ #########################'. ##########################| #######################---| ##########################| ##########################| ######################____| asciiend >o@myX@,@myZ-12@,@skullColor@,ascii # # # # # # # ######( ) ######; / #####/ / ####/ / ###; '.______.-‾‾‾`. ##(________;__,-///> asciiend ?stateTime/2 = 5 >o@myX@,@myZ-12@,@skullColor@,ascii ###########_.-----._ __///‾` #########.' '. '.| ########/ ___, __,\ |; #######| \ (_*) ,(_*);----|. #######| ) _ /!) ) | | ########`.__,.) (' | . #######/ '. `'""'´/._____|. '. ######| \ \‾._____/ ;._ `. | ######|. '-.__,''._.'###‾‾-____) ######\ '.___,''._.' #####.' \__\##/__/ ####[_.'#### # asciiend >o@myX@,@myZ-12@,@chestColor@,ascii #####################__ ##########################'. ###########################| #######################----| ###########################| ###########################| ######################_____| asciiend >o@myX@,@myZ-12@,@skullColor@,ascii # # # # # # # ######( ) ######; '. #####‾ / ‾. ####_ / ‾‾-- ‾.___ ###- ‾‾. ###((___---‾‾‾----,,///> asciiend