Anti Helm-Hat Combo Script



  • Add this function to your OnPlayerEquipItem Event Script on the Module Events in order to prevent Helmet-Hat Combo equipping:

    void AntiHatHelmetCombo()
    {
    
        object oItem = GetPCItemLastEquipped();
        object oPC   = GetPCItemLastEquippedBy();
    
        if (!GetIsPC(oPC)) return;
    
        //Check if PC has a Helmet Equipped and then if the PC chose to also equip a hat
        if(((GetItemInSlot(INVENTORY_SLOT_HEAD, oPC)) != OBJECT_INVALID) && ((GetBaseItemType(oItem) == BASE_ITEM_CLOAK) && (GetItemAppearance(oItem, 0,0)== 22)))
        {
            AssignCommand(oPC, ActionUnequipItem(oItem));
            //Error Message that is sent to the PC
            SendMessageToPC(oPC, "The hat doesnt seem to fit on your helm! You think it might be wise to first remove your helm!");
            return;
        }
    
        //Check if PC has a Hat Equipped and then if the PC chose to also equip a helmet
        else if(((GetItemInSlot(INVENTORY_SLOT_CLOAK, oPC) != OBJECT_INVALID) && (GetItemAppearance(GetItemInSlot(INVENTORY_SLOT_CLOAK, oPC), 0,0) == 22))&& (GetBaseItemType(oItem) == BASE_ITEM_HELMET))
        {
            AssignCommand(oPC, ActionUnequipItem(oItem));
            SendMessageToPC(oPC, "You cannot fit a helm under your hat! You think it might be wise to first remove your hat!");
            return;
        }
        return;
    }
    


  • Yep, that'll totally work. But that's not the only way to get hats, I think they are also part of some armours as well, but it'd fix it for that case.



  • Will need to factor in a third option that its part of an outfit, specifically robe appearance.
    I'll try to add that section later on.


  • Storyteller [DM]

    Somewhere in the world MrRagingunshine just felt a bit dizzy



  • But.. why?



  • Corrected the original code I wrote per Zool's challenge and the new version will also account for Outfits with built-in hats.
    The function just needs to be added to the OnPlayerEquipItem in the Module Events:

    //void AntiHatHelmetCombo Function v2, by Seter
    
    void AntiHatHelmetCombo_2()
    {
        object oItem = GetPCItemLastEquipped();
        object oPC   = GetPCItemLastEquippedBy();
    
        if (!GetIsPC(oPC)) return;
    
        //Check if PC has a Helmet Equipped first and then if the PC chose to also equip a hat OR Outfit with a Hat built-in
        if(GetItemInSlot(INVENTORY_SLOT_HEAD, oPC) != OBJECT_INVALID)
        {
            if((GetBaseItemType(oItem) == BASE_ITEM_CLOAK && GetItemAppearance(oItem, 0,0)== 22 ) || (GetBaseItemType(oItem) == BASE_ITEM_ARMOR && GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_MODEL,ITEM_APPR_ARMOR_MODEL_ROBE) == 168))
            {
                AssignCommand(oPC, ActionUnequipItem(oItem));
                //Error Message that is sent to the PC
                SendMessageToPC(oPC, "The hat doesnt seem to fit on your helm! You think it might be wise to first remove your helm!");
                return;
            }
        }
    
        //Check if PC has a Hat OR Outfitwith a Hat built-in Equipped and then if the PC chose to also equip a Helmet
        if((GetItemInSlot(INVENTORY_SLOT_CLOAK, oPC) != OBJECT_INVALID && GetItemAppearance(GetItemInSlot(INVENTORY_SLOT_CLOAK, oPC), 0,0) == 22) || (GetItemInSlot(INVENTORY_SLOT_CHEST, oPC) != OBJECT_INVALID && GetItemAppearance(GetItemInSlot(INVENTORY_SLOT_CHEST, oPC), ITEM_APPR_TYPE_ARMOR_MODEL,ITEM_APPR_ARMOR_MODEL_ROBE) == 168))
        {
            if(GetBaseItemType(oItem) == BASE_ITEM_HELMET)
            {
                AssignCommand(oPC, ActionUnequipItem(oItem));
                SendMessageToPC(oPC, "You cannot fit a helm under your hat! You think it might be wise to first remove your hat!");
                return;
            }
        }
        return;
    }
    


  • Instead, it should mark the PC as hostile to all factions.

    More realistic.


  • Admin [DM]

    I love you! This is great


  • Dwarves

    you will need to script that hats, as well as helms, also stop hair being plucked as well as that is a motivation to wear the hat/helm combo.



  • Yeah, that'd be fairly easy to do, just checking for these appearances. Though really, I planned to modify the .pluck thing, to set your pickpocket mode to plucking hairs, instead of having have type a persons entier name into the .pluck dot command.

    So you'd type .pluck, get a message saying "You will now attempt to remove hair instead of pick pockets" then use pick pocket on the dude, it does that stuff, then you .pluck again to swap back.


  • Admin [DM]

    Has this been put in yet?



  • What's the point? Is there some magic in the realms that prevents putting a feathered cap on top of a metal helmet?

    I agree it's silly. But that's not the point. Is there a reason for limiting a players options for expressing the demeanor of their characters? My character is flamboyant and silly. I see no reason for implementing something like this.

    Unless of course you fix the fact that half of the helmets in the mod with properties can't be modified.

    I'm in the camp of hat helmets looks really stupid, and is really stupid. But the only thing more stupid to me, is to tell players that they can't do it because we are enforcing a dress code now. This is not immersion breaking.



  • I think this is what is commonly referred to as a joke post.



  • Helmets that can't be modified, but should be able to be can be fixed.



  • @Puffy:

    Has this been put in yet?

    Thats what she said.



  • This thread makes me sick.

    !



  • Hatmets are HERESY in the eyes of the EMPRAH. Only Slaneesh cultists would dare wear such



  • @verkosh:

    Hatmets are HERESY in the eyes of the EMPRAH. Only Slaneesh cultists would dare wear such

    The verk speaks truth.


Log in to reply