Author Topic: Can someone edit this?  (Read 327 times)

Legacy_Builder_Anthony

  • Hero Member
  • *****
  • Posts: 786
  • Karma: +0/-0
Can someone edit this?
« on: July 16, 2011, 01:43:28 am »


               I need the script below to:


check if the entering creature is wearing metal torso armor
if so then create a vfx of chain lightning hitting the creature wearing armor
add 1-4 damage
play animation ........umm know any cool animations of getting zapped?If so add it here
else
not zapped so apply 1-2 electrical damage


//for archway
//Put this script OnEnter
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
object oTarget;
oTarget = GetObjectByTag("XHERE");
int nInt;
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_DUR_GLOW_WHITE), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_DUR_GLOW_WHITE), GetLocation(oTarget));
}                                                    
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Can someone edit this?
« Reply #1 on: July 16, 2011, 05:31:43 pm »


               I can't readily think of a way to determine if the armor is metal other than checking the weight of the armor item. A quick glance through the toolset would seem to indicate if it weighs more than 15 pounds it "should" be metal. But there are some exceptions.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Can someone edit this?
« Reply #2 on: July 16, 2011, 06:32:07 pm »


               We treat armor with ac over 3 as having enough metal components to count as metal. This excludes studded leather and hide. The following code has consts for cep items. If you don't  use them, you can remove them. I include the const values at the top.


const int BASE_ITEM_CEP_HEAVYPICK                                 = 301;
const int BASE_ITEM_CEP_LIGHTPICK                                 = 302;
const int BASE_ITEM_CEP_SAI                                       = 303;
const int BASE_ITEM_CEP_FALCHION                                  = 305;
const int BASE_ITEM_CEP_ASSASSINDAGGER                            = 309;
const int BASE_ITEM_CEP_KATAR                                     = 310;
const int BASE_ITEM_CEP_HEAVYMACE                                 = 317;
const int BASE_ITEM_CEP_MAUL                                      = 318;
const int BASE_ITEM_CEP_MERCURIALLONGSWORD                        = 319;
const int BASE_ITEM_CEP_MERCURIALGREATSWORD                       = 320;
const int BASE_ITEM_CEP_DOUBLESCIMITAR                            = 321;
const int BASE_ITEM_CEP_GOAD                                      = 322;
const int BASE_ITEM_CEP_WINDFIREWHEEL                             = 323;
const int BASE_ITEM_CEP_DOUBLEPICK                                = 324;

int GetItemACBase (object oItem) {
    if (!GetIsObjectValid(oItem))
        return 0;

    switch (GetBaseItemType(oItem)) {
        case BASE_ITEM_SMALLSHIELD:
            return 1;

        case BASE_ITEM_LARGESHIELD:
            return 2;

        case BASE_ITEM_TOWERSHIELD:
            return 3;

        case BASE_ITEM_ARMOR:
            break;

        default:
            return 0;
    }

    int bID = GetIdentified(oItem);

    SetIdentified(oItem, FALSE);

    int nBaseAC = 0;

    switch (GetGoldPieceValue(oItem)) {
        case 5:    nBaseAC = 1; break;  // Padded
        case 10:   nBaseAC = 2; break;  // Leather
        case 15:   nBaseAC = 3; break;  // Studded Leather / Hide
        case 100:  nBaseAC = 4; break;  // Chain Shirt / Scale Mail
        case 150:  nBaseAC = 5; break;  // Chainmail / Breastplate
        case 200:  nBaseAC = 6; break;  // Splint Mail / Banded Mail
        case 600:  nBaseAC = 7; break;  // Half Plate
        case 1500: nBaseAC = 8; break;  // Full Plate
    }

    SetIdentified(oItem, bID);

    return nBaseAC;
}

int GetItemIsMetal (object oItem) {
    switch (GetBaseItemType(oItem)) {
        case BASE_ITEM_ARMOR:
            if (GetItemACBase(oItem) > 3)
                return TRUE;
            break;

        case BASE_ITEM_SMALLSHIELD:
        case BASE_ITEM_LARGESHIELD:
        case BASE_ITEM_TOWERSHIELD:
            return TRUE;

        case BASE_ITEM_BASTARDSWORD:
        case BASE_ITEM_BATTLEAXE:
        case BASE_ITEM_DAGGER:
        case BASE_ITEM_DIREMACE:
        case BASE_ITEM_DOUBLEAXE:
        case BASE_ITEM_DWARVENWARAXE:
        case BASE_ITEM_GREATAXE:
        case BASE_ITEM_GREATSWORD:
        case BASE_ITEM_HALBERD:
        case BASE_ITEM_HANDAXE:
        case BASE_ITEM_HEAVYFLAIL:
        case BASE_ITEM_KAMA:
        case BASE_ITEM_KATANA:
        case BASE_ITEM_KUKRI:
        case BASE_ITEM_LIGHTFLAIL:
        case BASE_ITEM_LIGHTHAMMER:
        case BASE_ITEM_LIGHTMACE:
        case BASE_ITEM_LONGSWORD:
        case BASE_ITEM_MORNINGSTAR:
        case BASE_ITEM_RAPIER:
        case BASE_ITEM_SCIMITAR:
        case BASE_ITEM_SCYTHE:
        case BASE_ITEM_SHORTSPEAR:
        case BASE_ITEM_SHORTSWORD:
        case BASE_ITEM_SICKLE:
        case BASE_ITEM_TRIDENT:
        case BASE_ITEM_TWOBLADEDSWORD:
        case BASE_ITEM_WARHAMMER:
            return TRUE;

        case BASE_ITEM_CEP_ASSASSINDAGGER:
        case BASE_ITEM_CEP_DOUBLEPICK:
        case BASE_ITEM_CEP_DOUBLESCIMITAR:
        case BASE_ITEM_CEP_FALCHION:
        case BASE_ITEM_CEP_GOAD:
        case BASE_ITEM_CEP_HEAVYMACE:
        case BASE_ITEM_CEP_HEAVYPICK:
        case BASE_ITEM_CEP_KATAR:
        case BASE_ITEM_CEP_LIGHTPICK:
        case BASE_ITEM_CEP_MERCURIALGREATSWORD:
        case BASE_ITEM_CEP_MERCURIALLONGSWORD:
        case BASE_ITEM_CEP_MAUL:
        case BASE_ITEM_CEP_SAI:
        case BASE_ITEM_CEP_WINDFIREWHEEL:
            return TRUE;
    }

    return FALSE;
}


Funky
               
               

               
            

Legacy_Builder_Anthony

  • Hero Member
  • *****
  • Posts: 786
  • Karma: +0/-0
Can someone edit this?
« Reply #3 on: July 16, 2011, 07:19:07 pm »


               Ok ya i use cep as well so the constants are cool......I guess if they have over 15 pounds might be a easier way of doing it though..........Another cool thing might be to apply a weapon vfx temporairly to the weapon in the creatures hand.

Maybe give them a save vs electic if they have under 40 pounds 15 pounds everyone seems to awalys carry.
               
               

               


                     Modifié par Builder_Anthony, 16 juillet 2011 - 06:20 .
                     
                  


            

Legacy_Builder_Anthony

  • Hero Member
  • *****
  • Posts: 786
  • Karma: +0/-0
Can someone edit this?
« Reply #4 on: July 17, 2011, 07:27:13 pm »


               Bump