Author Topic: Pausing a Battle for a Conversation  (Read 310 times)

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Pausing a Battle for a Conversation
« on: June 11, 2011, 03:42:24 am »


               Hello all.  I am trying to "pause' a battle between a PC and an NPC when the NPC reaches a certain number of HP; in this case, 1 HP.

I set the NPC to immortal, so I am not worried about a crit sneaking through ruining my convo.  But what I am having trouble with is getting my PC to "settle down", as he remains hostile no matter what I have tried, and cannot engage in a conversation because he is "too excited" to talk to the NPC.

Below is the script I wrote, and I know, it looks like crap.  I tried everything I could think of, looking in the Lexicon to see what functions approximate the behavior I am trying to achieve, but I just can't either

a) Get the order right

or

'B)' I am missing another crucial command.

Can anyone help me with this?

Thanks, Russell '<img'>

//placed in the OnCombatRoundEnd handle

void main()
{
//Setting oAttacker as the last object to attack the NPC; object will only be a PC
object oAttacker = GetLastHostileActor(OBJECT_SELF);

//Here I am trying to find how many HP are left on the NPC
int iHP = GetCurrentHitPoints(OBJECT_SELF);

//When the HP's drop to 1, fire the script.  Side note, the NPC is immortal, so
//I am not worried that a lucky crit at this juncture will ruin what I am
//trying to achieve.
if (GetCurrentHitPoints(OBJECT_SELF) != 1)
    //Still more than 1 hp, so exit the script
    return;

else
    {
    //Thought this would set me up properly, clearing all actions
    ClearAllActions(TRUE);

    //Tried to clear reputations, hoping that would make them stop hitting each other
    ClearPersonalReputation(oAttacker, OBJECT_SELF);
    ClearPersonalReputation(OBJECT_SELF, oAttacker);

    //Then tried this to achieve the same
    SetIsTemporaryFriend(oAttacker, OBJECT_SELF);

    //And finally, my convo.
    ActionStartConversation(oAttacker, "chl_brokwounded", FALSE, FALSE);
    }


}

               
               

               


                     Modifié par WoC_Builder, 11 juin 2011 - 02:49 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Pausing a Battle for a Conversation
« Reply #1 on: June 11, 2011, 04:57:34 am »


               SurrenderToEnemies()
You can read more about the function in the lexicon. Just search for the surrender functions.
               
               

               
            

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Pausing a Battle for a Conversation
« Reply #2 on: June 11, 2011, 05:19:55 am »


               *slaps forehead*  DOH!  Thanks for the pointer in the right direction!  Looks exactly like what I need.

Many thanks again '<img'>