Author Topic: How to create a Potion to transform Half-Orc to Orc ? Just scripting On Used  (Read 331 times)

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0


               

How to create a Potion to transform Half-Orc to Orc? Just scripting On Used


 


To add Extra HP, Str and Skill Discipline.


 


the polymorph finish when PC dye or rest



               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0


               

I'm with this script (on active item):



    if (sItemResRef == "item060")
    {
             FloatingTextStringOnCreature ("Grr... it tastes bad!", oPC);
             if(GetRacialType(oPC) == 5)
             {
             location lLocationOrc = GetLocation(oPC);
             effect eVisualSummonOrc = EffectVisualEffect(VFX_IMP_POLYMORPH);
             effect ePolymorphOrc = EffectPolymorph(POLYMORPH_TYPE_CELESTIAL_AVENGER, TRUE);
             SetLocalInt(oPC, "TransformedIntoOrc", TRUE);
             SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 5, oPC);
             SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 5, oPC);
             SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 5, oPC);
             SetCutsceneMode(oPC, TRUE);
             AssignCommand(oPC, ClearAllActions());
             AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_SPASM, 1.0, 1.5));
             DelayCommand (1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVisualSummonOrc, lLocationOrc));
             DelayCommand (1.1, ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePolymorphOrc, oPC));
             DelayCommand (1.2, SetCutsceneMode(oPC, FALSE));
             }
    }

But we do not have polymorph_type_orc constant...



               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0


               

Could us add a new polymorph_type to polymorph.2da?


 


Example:


 


107   POLYMORPH_TYPE_ORC1        x              x            x         x      ****               ****               ****               x     x   x     ****   x     x               x        ****       x      ****     ****     1        1        1



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0


               

The polymorph constants are just row numbers.  If you know the number, you do not need to use the constant.  New entries can be made, which of course will not have constants, but you can still reference them by their row number.



               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0


               

I am using Cel. Avenger polymorph edited: 


 


38     POLYMORPH_TYPE_CELESTIAL_AVENGER                 140              14           271          po_Orca ****   ****      **** courdorc         waxmbt004          30     18     10     15               0       73         ****     ****     ****     ****     1        1     

 

140 = model orcA

14 = race orc

271 = portrait


               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0


               

Place your script snippet into a new script with the same name as the tag of the item (item060.nss). Like this...


 


//::///////////////////////////////////////////////

//:: Tag Based Item script

//:: z1_it_trap048.nss

//:://////////////////////////////////////////////

 

#include "x0_i0_spells"

 


void main()

{

    int nEvent =GetUserDefinedItemEventNumber();

    object oPC;

    //object oItem;


 

    if (nEvent ==  X2_ITEM_EVENT_ACTIVATE)


    {

        oPC   = GetItemActivator();

        //oItem = GetItemActivated();

 


        FloatingTextStringOnCreature ("Grr... it tastes bad!", oPC);

        if(GetRacialType(oPC) == 5)

        {

            location lLocationOrc = GetLocation(oPC);

            effect eVisualSummonOrc = EffectVisualEffect(VFX_IMP_POLYMORPH);

            effect ePolymorphOrc = EffectPolymorph(POLYMORPH_TYPE_CELESTIAL_AVENGER, TRUE);

            SetLocalInt(oPC, "TransformedIntoOrc", TRUE);

            SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 5, oPC);

            SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 5, oPC);

            SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 5, oPC);

            SetCutsceneMode(oPC, TRUE);

            AssignCommand(oPC, ClearAllActions());

            AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_SPASM, 1.0, 1.5));

            DelayCommand (1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVisualSummonOrc, lLocationOrc));

            DelayCommand (1.1, ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePolymorphOrc, oPC));

            DelayCommand (1.2, SetCutsceneMode(oPC, FALSE));


     }

}


               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0


               

Thank you Pstemarie.


 


I added a weapon on "Equipped" in my 2da edits, but I also would like to add a shield. Is it possible to a polymorph be equipped with Weapon and Shield?



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0


               

Due to the way the columns are set up, it does not look like the hard-code supports other item slots besides the ones already there.  While you can assign a shield or torch to the EQUIPPED column, it is not generally a good idea to do this.  Instead of the shield or torch being redirected to the off-hand (as is normal when you try to place them in the main hand), a polymorph will keep the shield or torch in the main hand and use it as the weapon that the polymorph fights with.  This means no weapon base damage or bonus damage (due to the properties torches and shields allow), and on-hit properties will trigger when the polymorph attacks and affect the polymorph (rather than the target of the attack).  This means that if an ally casts flame weapon on a polymorph wielding a shield the polymorph will be dealt fire damage by whatever target he is attacking whenever his blows hit.