Skip to content

Whirlwind

Is it even possible to force a PC to do a whirlwind attack. This is purely for esthetic reasons. Here's my code:

ActionDoCommand(ActionUseFeat(FEAT_WHIRLWIND_ATTACK, GetNearestEnemy(oPC)));

When my PC steps on the trigger, the character stutter-steps. But no whirlwind attack. They don't actually have to have the feat, right?
Oh, also I'm getting a script error in the chat box saying something along the lines of "error divided by zero". First I've never seen this before?

Comments

  • ForSeriousForSerious Member Posts: 466
    I have never gotten that either.
    Humm this is from the whirlwind attack feat script:
    DoWhirlwindAttack(TRUE,bImproved);
    
    // Does a single attack on every hostile creature within 10ft. of the attacker
    // and determines damage accordingly.  If the attacker has a ranged weapon
    // equipped, this will have no effect.
    // ** NOTE ** This is meant to be called inside the spell script for whirlwind
    // attack, it is not meant to be used to queue up a new whirlwind attack.  To do
    // that you need to call ActionUseFeat(FEAT_WHIRLWIND_ATTACK, oEnemy)
    // - int bDisplayFeedback: TRUE or FALSE, whether or not feedback should be
    //   displayed
    // - int bImproved: If TRUE, the improved version of whirlwind is used
    void DoWhirlwindAttack(int bDisplayFeedback=TRUE, int bImproved=FALSE)
    
  • ZephiriusZephirius Member Posts: 419
    Yeah I tried that first to no avail. Then I read on the Lexicon about ActionUseFeat(), and can't get that to work either.
    It's always something... :)
  • ForSeriousForSerious Member Posts: 466
    I was really hoping to find that there is an animation for it that gets called in the feat script. There isn't. There is a whole ton of custom animation options, but I think those are just so you can easily map them to hackpack content.
  • NeverwinterWightsNeverwinterWights Member Posts: 339
    I believe the player has to have the feat in order for it to work. But you can temporarily add it as an item property and then remove it after you're done.
    void RemoveTempWhirlwind(object oItem)
    {
        itemproperty ipRemove = GetFirstItemProperty(oItem);
        while (GetIsItemPropertyValid(ipRemove))
        {
            if (GetItemPropertyTag(ipRemove) == "TEMP_WHIRLWIND")
            {
                RemoveItemProperty(oItem, ipRemove);
            }
            ipRemove = GetNextItemProperty(oItem);
        }
    }
    
    void main()
    {
        object oPC = GetLastUsedBy();//Test using a placeable useable object
        object oSkin = GetItemInSlot(INVENTORY_SLOT_CARMOUR, oPC);//Player skin object
        itemproperty ipWhirlwind = TagItemProperty(ItemPropertyBonusFeat(IP_CONST_FEAT_WHIRLWIND), "TEMP_WHIRLWIND");
    
        AddItemProperty(DURATION_TYPE_PERMANENT, ipWhirlwind, oSkin);
        AssignCommand(oPC, ActionUseFeat(FEAT_WHIRLWIND_ATTACK, OBJECT_SELF));
        //Delay required or feat will be removed before you can use it
        DelayCommand(3.0, RemoveTempWhirlwind(oSkin));
    }
    

    Hope it helps.
  • ZephiriusZephirius Member Posts: 419
    Thanks guys. Yeah, I just loaded up a character who has whirlwind and it works as long as you have the feat. Gonna try NeverwinterWights script. :)
Sign In or Register to comment.