Wildshape Update



  • While mucking around with other things, I decided to update it for practice. New non-conversation based form using PlayerChat commands. (I've sent an erf of the larger ws_translate as well.).

    With quickslotted text macros, this lets you keep more then five handy, and your quickslots won't drop out on reset.

    Adding the translation line here is also probably easier then making a new conversation option for any new forms (Snakes!), too.

    This goes in the OnPlayerChat

        object oPC = GetPCChatSpeaker();
        string sCommand = GetPCChatMessage();
        object oToken = GetItemPossessedBy(oPC, "nolose_ctoken");
        //wildshape command, also, check for the feat. GetHasFeat also checks usable state for charges
        if (GetSubString(sCommand, 1, 2) == "ws" && GetHasFeat(FEAT_WILD_SHAPE, oPC))
        {
            SetLocalString(oToken, "ws_com_temp", sCommand);
            ExecuteScript("ws_translate", oPC);
        }
    
    


  • And this behemoth I kept in a separate script, myself (though it could be stuck in the other one, it'd make finding separate commands annoying)

    /////ws_translate
    /////Seth Carter, 2010
    /////Translates a player chat input of ".ws " into the polymorph codes
    /////and executes the appropriate one using a use of wildshape.
    
    #include "x2_inc_itemprop"
    
    void main()
    {
        //pick the command back up from where we put it
        object oPC = OBJECT_SELF;
        object oToken = GetItemPossessedBy(oPC, "nolose_ctoken");
        string sCommand = GetLocalString(oToken, "ws_com_temp");
        int nStringLength = GetStringLength(sCommand) - 4;
        string sFormID = GetStringRight(sCommand, nStringLength);
    
        //duration and stuff from the wildshape script
        effect eVis = EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_NATURE);
        effect ePoly;
        int nPoly = 0;
        int nDuration = GetLevelByClass(CLASS_TYPE_DRUID);
    
        ///Decoder time
        if(sFormID == "Badger"){
            nPoly = 25; }
        else if(sFormID == "Bat"){
            nPoly = 140; }
        else if(sFormID == "Black Bear"){
            nPoly = 131; }
        else if(sFormID == "Boar"){
            nPoly = 24; }
        else if(sFormID == "Brown Bear"){
            nPoly = 21; }
        else if(sFormID == "Chicken"){
            nPoly =  40; }
        else if(sFormID == "Cougar"){
            nPoly =  135; }
        else if(sFormID == "Cow"){
           nPoly =  141; }
        else if(sFormID == "Crag Cat"){
            nPoly =  136; }
        else if(sFormID == "Deer"){
            nPoly =  142; }
        else if(sFormID == "Dog"){
            nPoly =  130; }
        else if(sFormID == "Falcon"){
            nPoly =  133; }
        else if(sFormID == "Leopard"){
            nPoly =  138; }
        else if(sFormID == "Lion"){
            nPoly =  139; }
        else if(sFormID == "Ox"){
            nPoly =  143; }
        else if(sFormID == "Panther"){
            nPoly =  22; }
        else if(sFormID == "Penguin"){
            nPoly =  132; }
        else if(sFormID == "Rat"){
            nPoly =  144; }
        else if(sFormID == "Raven"){
            nPoly =  134; }
        else if(sFormID == "White Stag"){
            nPoly =  145; }
        else if(sFormID == "Wolf"){
            nPoly =  23; }
        else if(sFormID == "White Wolf"){
            nPoly =  146; }
        //second tier
        else if (GetLevelByClass(CLASS_TYPE_DRUID, oPC) >= 8){
                if(sFormID == "Grizzly Bear"){
                    nPoly =  147; }
                else if(sFormID == "Polar Bear"){
                    nPoly =  148; }
                //third tier
                else if (GetLevelByClass(CLASS_TYPE_DRUID, oPC) >= 12){
                    if(sFormID == "Dire Badger"){
                        nPoly =  37; }
                    else if(sFormID == "Dire Bear"){
                        nPoly =  33; }
                    else if(sFormID == "Dire Boar"){
                        nPoly =  36; }
                    else if(sFormID == "Dire Rat"){
                        nPoly =  149; }
                    else if(sFormID == "Dire Tiger"){
                        nPoly =  69; }
                    else if(sFormID == "Dire Wolf"){
                        nPoly =  35; }
                    //the enigmatic and legendary fourth tier
                    else if (GetLevelByClass(CLASS_TYPE_DRUID, oPC) >= 15){
                        if(sFormID == "Ancient Bear"){
                            nPoly =  150; }
                        else if(sFormID == "Pack Leader"){
                            nPoly =  151; }
                    }
                }
            }
        //couldn't determine the form and npoly is still 0
        if (nPoly == 0){
            SendMessageToPC(oPC, "Unknown animal type. Check spelling");}
        else if (nPoly > 0){
        //wildshape
            ePoly = EffectPolymorph(nPoly);
            ePoly = ExtraordinaryEffect(ePoly);
    
            int bWeapon = StringToInt(Get2DAString("polymorph","MergeW",nPoly)) == 1;
            int bArmor  = StringToInt(Get2DAString("polymorph","MergeA",nPoly)) == 1;
            int bItems  = StringToInt(Get2DAString("polymorph","MergeI",nPoly)) == 1;
    
            object oWeaponOld = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,OBJECT_SELF);
            object oArmorOld = GetItemInSlot(INVENTORY_SLOT_CHEST,OBJECT_SELF);
            object oRing1Old = GetItemInSlot(INVENTORY_SLOT_LEFTRING,OBJECT_SELF);
            object oRing2Old = GetItemInSlot(INVENTORY_SLOT_RIGHTRING,OBJECT_SELF);
            object oAmuletOld = GetItemInSlot(INVENTORY_SLOT_NECK,OBJECT_SELF);
            object oCloakOld  = GetItemInSlot(INVENTORY_SLOT_CLOAK,OBJECT_SELF);
            object oBootsOld  = GetItemInSlot(INVENTORY_SLOT_BOOTS,OBJECT_SELF);
            object oBeltOld = GetItemInSlot(INVENTORY_SLOT_BELT,OBJECT_SELF);
            object oHelmetOld = GetItemInSlot(INVENTORY_SLOT_HEAD,OBJECT_SELF);
            object oShield    = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,OBJECT_SELF);
            if (GetIsObjectValid(oShield))
            {
                if (GetBaseItemType(oShield) !=BASE_ITEM_LARGESHIELD &&
                    GetBaseItemType(oShield) !=BASE_ITEM_SMALLSHIELD &&
                    GetBaseItemType(oShield) !=BASE_ITEM_SMALLSHIELD)
                {
                    oShield = OBJECT_INVALID;
                }
            }
    
            //Apply the VFX impact and effects
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePoly, OBJECT_SELF, HoursToSeconds(nDuration));
    
            object oWeaponNew = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,OBJECT_SELF);
            object oArmorNew = GetItemInSlot(INVENTORY_SLOT_CARMOUR,OBJECT_SELF);
    
            if (bWeapon)
            {
                IPWildShapeCopyItemProperties(oWeaponOld,oWeaponNew, TRUE);
            }
            if (bArmor)
            {
                IPWildShapeCopyItemProperties(oShield,oArmorNew);
                IPWildShapeCopyItemProperties(oHelmetOld,oArmorNew);
                IPWildShapeCopyItemProperties(oArmorOld,oArmorNew);
            }
            if (bItems)
            {
                IPWildShapeCopyItemProperties(oRing1Old,oArmorNew);
                IPWildShapeCopyItemProperties(oRing2Old,oArmorNew);
                IPWildShapeCopyItemProperties(oAmuletOld,oArmorNew);
                IPWildShapeCopyItemProperties(oCloakOld,oArmorNew);
                IPWildShapeCopyItemProperties(oBootsOld,oArmorNew);
                IPWildShapeCopyItemProperties(oBeltOld,oArmorNew);
            }
            DecrementRemainingFeatUses(oPC, FEAT_WILD_SHAPE); //take away one wildshape use
    
        }
    
    } 
    


  • Whoops, minor glitch (scrtign at 5am is bad idea.

        int nStringLength = GetStringLength(sCommand) - 2; 
    
    

    shoudl be

        int nStringLength = GetStringLength(sCommand) - 4; 
    
    


  • This should also be implemented next reset.
    The old system is still 100% functionnal, but if you want to use chat commands it should work.

    The script was altered slightely to be up to date with the CoA version. There was some bug and exploit with wildshape that were fixed in the past, I don't want them to pop up again. 🙂

    You must write the correct name of the shape you want to take. I added a lowercase function on the string so it doesn't matter if you use small or capital letters.

    Further changes to the wildshape system should be applied to both nw_s2_wildShape and ws_translate now.


Log in to reply