Author Topic: removing 'soak' from items  (Read 472 times)

Legacy_lordofworms

  • Sr. Member
  • ****
  • Posts: 422
  • Karma: +0/-0
removing 'soak' from items
« on: April 04, 2011, 11:36:20 pm »


               Ok, I have a dilemma, I have some random players that ...
(waaaay back when I first started my PW and didnt have a clue I had a forge that was unrestricted)
...have like all sorts of soak damage bonuses stacked on armors,weapons,rings,etc..


how difficult would it be to write a script that I could run from a DM item that would remove any/all soak bonuses from the targeted item.

I tried writing it and though I can remove all other sorts of effects like immunities and the like I just cannot get this one to remove these soak bonuses.

as a DM I know I could just 'remove' the item entirely, but I kind of wanted to be gentle and let them keep any of the other bonuses they might have had on said item.

possible? if so I hate to ask if someone could show me a quick example how you determine and remove a soak bonus I would be greatly appreciative...the rest of the scripting (the tag based,etc target and such I can write)

thank you as always for being great!
               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
removing 'soak' from items
« Reply #1 on: April 05, 2011, 12:06:57 am »


               LoW, your going to run into a ton of problems, even if you get a script to do it automaticaly. Players hate having gear removed. They hate exchanging gear, especialy when the new gear won't have said soaking ability, even more. No mater how you try and get rid of all the old soaking gear your going to have tantrums. Your best bet, if your players are teh RPin' kind is to make a special DM event, that causes the soaking gear to be destroyed. Yes it will take a huge amount of planning on your end, yes they will probably still hate you for removing the soak item, but with an RP event, at least they have the "chance" to play it out. You can destroy it in several ways, IE acid from some creature, a thief in the night, wild magic zone, or plain ol' character misuse. good luck!
               
               

               
            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
removing 'soak' from items
« Reply #2 on: April 05, 2011, 01:05:18 am »


               While players don't like having things altered, it IS your server and your call. It could be scripted easy, I'd recommend the script run on equip of an item so it uses little resource and is triggered only on occasion, OR, a mass sort of PC gear on_enter - tho that can get laggy if you got lots of gear and / or sloppy script. If you like, ask, and I'll cobble something lean and mean together for you.  IMHO it is best to do it for 'in game reasons' such as "this power causes a surge in magic when used".:innocent:
               
               

               


                     Modifié par ehye_khandee, 05 avril 2011 - 12:06 .
                     
                  


            

Legacy_lordofworms

  • Sr. Member
  • ****
  • Posts: 422
  • Karma: +0/-0
removing 'soak' from items
« Reply #3 on: April 05, 2011, 01:46:42 am »


               Well I have a small player base and I am not doing this mean like...the players know what i am doing, its just they spent a long time getting their armor colors,style,parts,description and name all set and I just dont want to 'remove' the item because of that. Many just said 'take it' and that they would just remake it..but I figured to ask first. if it was something simple-like.

I would prefer a OnEquip script but I would settle for anything, tag based item, onenter script.
Thank you both for your quick response.
               
               

               
            

Legacy_Dark Defiance

  • Full Member
  • ***
  • Posts: 125
  • Karma: +0/-0
removing 'soak' from items
« Reply #4 on: April 05, 2011, 02:06:53 am »


               I have something like that already (for other reasons). Let me modify and test and Ill PM you when its done.

-DD
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
removing 'soak' from items
« Reply #5 on: April 05, 2011, 03:17:34 am »


               You could integrate something like this into your modules OnPlayerEquipItem script:


void main()
{
    object oItem = GetPCItemLastEquipped();
    int iSoakCheck = GetLocalInt(oItem, "SOAK_CHECKED");

    if (!iSoakCheck)
    {
        itemproperty ipSoak = GetFirstItemProperty(oItem);

        while (GetIsItemPropertyValid(ipSoak))
        {
            if (GetItemPropertyType(ipSoak) == ITEM_PROPERTY_DAMAGE_REDUCTION)
            {
                RemoveItemProperty(oItem, ipSoak);
            }
            ipSoak = GetNextItemProperty(oItem);
        }

        SetLocalInt(oItem, "SOAK_CHECKED", TRUE);
    }
}


Compiled but untested. It also sets a variable on each item to make sure it only does the loop and remove once and not everytime they equip the item.

Hope it helps. Good luck.
               
               

               
            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
removing 'soak' from items
« Reply #6 on: April 05, 2011, 03:52:13 am »


               They beat me to it - but GOG's script looks to do the trick. Let me know if you need anything down the line LoW.
               
               

               
            

Legacy_lordofworms

  • Sr. Member
  • ****
  • Posts: 422
  • Karma: +0/-0
removing 'soak' from items
« Reply #7 on: April 05, 2011, 12:20:05 pm »


               Thank you very much for your help everyone, as always you all always come through in perfect style!. I love this community.