City of Arabel

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Anti Helm-Hat Combo Script

    Scripting
    12
    18
    2507
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Seter
      Seter House Cormaeril of Arabel last edited by

      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;
      }
      

      Past Characters:

      • Hound
      • Artieus Fireheart
      • Doombringer Ezekiel Gideon
      • Ignatius B. Pike, Apprentice of Kanthea
      1 Reply Last reply Reply Quote
      • Zool
        Zool last edited by

        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.

        > !!!MOLES for the MOLE GOD!!!

        1 Reply Last reply Reply Quote
        • Seter
          Seter House Cormaeril of Arabel last edited by

          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.

          Past Characters:

          • Hound
          • Artieus Fireheart
          • Doombringer Ezekiel Gideon
          • Ignatius B. Pike, Apprentice of Kanthea
          1 Reply Last reply Reply Quote
          • Hominid
            Hominid last edited by

            Somewhere in the world MrRagingunshine just felt a bit dizzy

            stevelichman: When i get in pvp… I just generally don't even bother with my consumables, I just use my time more efficiently to come up with a witty one liner to use after my inevitable defeat.

            1 Reply Last reply Reply Quote
            • Locke
              Locke last edited by

              But.. why?

              I will build a great wall -- and nobody builds walls better than me, believe me --and I'll build them very inexpensively. I will build a great, great wall on our Old Town border, and I will make The Cobble Demons pay for that wall. Mark my words.

              1 Reply Last reply Reply Quote
              • Seter
                Seter House Cormaeril of Arabel last edited by

                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;
                }
                

                Past Characters:

                • Hound
                • Artieus Fireheart
                • Doombringer Ezekiel Gideon
                • Ignatius B. Pike, Apprentice of Kanthea
                1 Reply Last reply Reply Quote
                • HellzYeah
                  HellzYeah last edited by

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

                  More realistic.

                  Magpie [17:05] I am begining to notice that people have my quotes within their signitures on the forums <_<

                  1 Reply Last reply Reply Quote
                  • Puffy
                    Puffy Admin [DM] last edited by

                    I love you! This is great

                    @SpiffyMeister
                    the real bench mark for success is if you seduce a puffy pc or npc
                    @Prof-Misclick
                    Puffy said "Don't you trust me? Then vote yes NERD!"
                    #scaredofstrongwomen

                    1 Reply Last reply Reply Quote
                    • Cadiz
                      Cadiz last edited by

                      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.

                      Zool's rule - don't be a dick.

                      1 Reply Last reply Reply Quote
                      • Zool
                        Zool last edited by

                        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.

                        > !!!MOLES for the MOLE GOD!!!

                        1 Reply Last reply Reply Quote
                        • Puffy
                          Puffy Admin [DM] last edited by

                          Has this been put in yet?

                          @SpiffyMeister
                          the real bench mark for success is if you seduce a puffy pc or npc
                          @Prof-Misclick
                          Puffy said "Don't you trust me? Then vote yes NERD!"
                          #scaredofstrongwomen

                          1 Reply Last reply Reply Quote
                          • golw
                            golw last edited by

                            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.

                            1 Reply Last reply Reply Quote
                            • HellzYeah
                              HellzYeah last edited by

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

                              Magpie [17:05] I am begining to notice that people have my quotes within their signitures on the forums <_<

                              1 Reply Last reply Reply Quote
                              • Zool
                                Zool last edited by

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

                                > !!!MOLES for the MOLE GOD!!!

                                1 Reply Last reply Reply Quote
                                • DiaboSatan
                                  DiaboSatan last edited by

                                  @Puffy:

                                  Has this been put in yet?

                                  Thats what she said.

                                  City of Arabel biggest fan.

                                  1 Reply Last reply Reply Quote
                                  • LordOfPancake
                                    LordOfPancake last edited by

                                    This thread makes me sick.

                                    !

                                    1 Reply Last reply Reply Quote
                                    • V-Rage
                                      V-Rage last edited by

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

                                      1 Reply Last reply Reply Quote
                                      • CitizenBane
                                        CitizenBane last edited by

                                        @verkosh:

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

                                        The verk speaks truth.

                                        magpie> If you don't want to die don't spit at a blueberry muffin

                                        khammy> Raaz was a sexy beast. The kind of guy when he beat you up, you get horny.

                                        1 Reply Last reply Reply Quote
                                        • 1 / 1
                                        • First post
                                          Last post