necromantic potions v2.0

Got any custom JavaScript additions/tweaks you think other people would like to see? Post 'em here!
Post Reply
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

necromantic potions v2.0

Post by dragon slayer »

Thanks to Xuri for helping me on nearly all my scripts.

UPDATE V2.0
Added pileable and decay tags to items.



What this does. best feature you will have on your shard. You can take those unused reagents and now create some really cool potions.

First i like to explain what materialize is

defintion ma·te·ri·al·ize
1. To cause to become real or actual: By building the house, we materialized a dream.
2. To cause to become materialistic: "Inequality has the natural and necessary effect . . . of materializing our upper class, vulgarizing our middle class, and brutalizing our lower class" (Matthew Arnold).
v.intr.
1. To assume material or effective form: Their support on the eastern flank did not materialize.
2. To take physical form or shape.
3. To appear, especially suddenly. See Synonyms at appear.

This way you not thinking why this dope use empty bottles when the potions bottle looks differant :)

So after explaining all that here iss the scripts
necropotions.dfn
[necromortar]
{
GET=base_item
NAME=a necromantic mortar and pestle
ID=0x1ae0
SCRIPT=5030
decay=1
}

[dragonsbloodpotion]
{
GET=base_item
NAME=Dragon's Blood Potion
ID=0x0E25
SCRIPT=5031
MOREY=1
decay=1
}

[batwingpotion]
{
GET=base_item
NAME=Batwing Potion
ID=0x0E26
SCRIPT=5031
MOREY=2
decay=1
}

[blackmoorpotion]
{
GET=base_item
NAME=Blackmoor Potion
ID=0x0E27
SCRIPT=5031
MOREY=3
decay=1
}

[bloodspawnpotion]
{
GET=base_item
NAME=Bloodspawn Potion
ID=0x0e28
SCRIPT=5031
MOREY=4
decay=1
}

[vialofbloodpotion]
{
GET=base_item
NAME=Vial of Blood Potion
ID=0x0efc
SCRIPT=5031
MOREY=5
decay=1
}

[bonepotion]
{
GET=base_item
NAME=Bone Potion
ID=0x0e29
SCRIPT=5031
MOREY=6
decay=1
}

[brimstonepotion]
{
GET=base_item
NAME=Brimstone Potion
ID=0x0e2a
SCRIPT=5031
MOREY=7
decay=1
}

[fertiledirtpotion]
{
GET=base_item
NAME=Fertile Dirt Potion
ID=0x0e2b
SCRIPT=5031
MOREY=8
decay=1
}

[executionerscappotion]
{
GET=base_item
NAME=Executioner's Cap Potion
ID=0x0e2c
SCRIPT=5031
MOREY=9
decay=1
}

[eyeofnewtpotion]
{
GET=base_item
NAME=Eye of Newt Potion
ID=0x0efb
SCRIPT=5031
MOREY=10
decay=1
}

[obsidianpotion]
{
GET=base_item
NAME=Obsidian Potion
ID=0x0efd
SCRIPT=5031
MOREY=11
decay=1
}

[pigironpotion]
{
GET=base_item
NAME=Pig Iron Potion
ID=0x0efe
SCRIPT=5031
MOREY=12
decay=1
}

[pumicepotion]
{
GET=base_item
NAME=Pumice Potion
ID=0x0eff
SCRIPT=5031
MOREY=13
decay=1
}

[serpentsscalepotion]
{
GET=base_item
NAME=Serpent's Scale Potion
ID=0x0f00
SCRIPT=5031
MOREY=14
decay=1
}

[deadwoodpotion]
{
GET=base_item
NAME=Dead Wood Potion
ID=0x0f02
SCRIPT=5031
MOREY=15
decay=1
}

[wyrmsheartpotion]
{
GET=base_item
NAME=Wyrm's Heart Potion
ID=0x0f03
SCRIPT=5031
MOREY=16
decay=1
}

[volcanicashpotion]
{
GET=base_item
NAME=Volcanic Ash Potion
ID=0x0f01
SCRIPT=5031
MOREY=17
decay=1
}

[emptybottle]
{
GET=base_item
NAME=an empty dragon's blood bottle
ID=0x0efd
decay=1
}

[emptybottle2]
{
GET=base_item
NAME=an empty batwing bottle
ID=0x0efe
decay=1
}

[emptybottle3]
{
GET=base_item
NAME=an empty blackmoor bottle
ID=0x0eff
decay=1
}

[emptybottle4]
{
GET=base_item
NAME=an empty bloodspawn bottle
ID=0x0f00
decay=1
}

[emptybottle5]
{
GET=base_item
NAME=an empty vial of blood bottle
ID=0x0f0e
decay=1
}

[emptybottle6]
{
GET=base_item
NAME=an empty bone bottle
ID=0x0e29
decay=1
}

[emptybottle7]
{
GET=base_item
NAME=an empty brimstone bottle
ID=0x0f02
decay=1
}

[emptybottle8]
{
GET=base_item
NAME=an empty Fertile Dirt bottle
ID=0x0f03
decay=1
}

[emptybottle9]
{
GET=base_item
NAME=an empty executioner's cap bottle
ID=0x0f04
decay=1
}

[emptybottle10]
{
GET=base_item
NAME=an empty eye of newt bottle
ID=0x0efb
decay=1
}

[emptybottle11]
{
GET=base_item
NAME=an empty obsidian bottle
ID=0x0efd
decay=1
}

[emptybottle12]
{
GET=base_item
NAME=an empty pig iron bottle
ID=0x0efe
decay=1
}

[emptybottle13]
{
GET=base_item
NAME=an empty pumice bottle
ID=0x0eff
decay=1
}

[emptybottle14]
{
GET=base_item
NAME=an empty serpent scale bottle
ID=0x0f00
decay=1
}

[emptybottle15]
{
GET=base_item
NAME=an empty volcanic ash bottle
ID=0x0f01
decay=1
}

[emptybottle16]
{
GET=base_item
NAME=an empty dead wood bottle
ID=0x0f02
decay=1
}

[emptybottle17]
{
GET=base_item
NAME=an empty wyrm's heart bottle
ID=0x0f03
decay=1
}

[dragonsblood]
{
GET=base_item
NAME=a dragon's blood
ID=0x0f82
pileable=1
amount=1
decay=1
}

[batwing]
{
GET=base_item
NAME=a batwing
ID=0x0f78
pileable=1
amount=1
decay=1
}

[blackmoor]
{
GET=base_item
NAME=a blackmoor
ID=0x0f79
pileable=1
amount=1
decay=1
}

[bloodspawn]
{
GET=base_item
NAME=a blood spawn
ID=0x0f7c
pileable=1
amount=1
decay=1
}

[vialofblood]
{
GET=base_item
NAME=a vial of blood
ID=0x0f7d
pileable=1
amount=1
decay=1
}

[bone]
{
GET=base_item
NAME=a bone
ID=0x0f7e
pileable=1
amount=1
decay=1
}

[brimstone]
{
GET=base_item
NAME=a brimstone
ID=0x0f7f
pileable=1
amount=1
decay=1
}

[fertiledirt]
{
GET=base_item
NAME=a fertile dirt
ID=0x0f81
pileable=1
amount=1
decay=1
}

[executionerscap]
{
GET=base_item
NAME=a executioners cap
ID=0x0f83
pileable=1
amount=1
decay=1
}

[eyeofnewt]
{
GET=base_item
NAME=a eye of newt
ID=0x0f83
pileable=1
amount=1
decay=1
}

[odbsidian]
{
GET=base_item
NAME=a odbsidian
ID=0x0f89
pileable=1
amount=1
decay=1
}

[pigiron]
{
GET=base_item
NAME=a pig iron
ID=0x0f8a
pileable=1
amount=1
decay=1
}

[pumice]
{
GET=base_item
NAME=a pumice
ID=0x0f8b
pileable=1
amount=1
decay=1
}

[seprentsscale]
{
GET=base_item
NAME=a seprents scale
ID=0x0f8e
pileable=1
amount=1
decay=1
}

[volcanicash]
{
GET=base_item
NAME=a volcanic ash
ID=0x0f8f
pileable=1
amount=1
decay=1
}

[deadwood]
{
GET=base_item
NAME=a dead wood
ID=0x0f90
pileable=1
amount=1
decay=1
}

[wyrmsheart]
{
GET=base_item
NAME=a wyrms heart
ID=0x0f91
pileable=1
amount=1
decay=1
}
necro.js
function onUseChecked ( pUser, iUsed )
 {
    // get users socket
    var srcSock = pUser.socket;

    // is it in users pack?
    if( iUsed.container != null )
    {
       var iPackOwner = GetPackOwner( iUsed, 0 );
       if( iPackOwner.serial != pUser.serial )
       {
          pUser.SysMessage( "This has to be in your backpack!" );
       }
       else
          srcSock.CustomTarget( 0, "What do you want to use the necromantic mortar and pestle with?" );
    }
    else
       pUser.SysMessage( "This has to be in your backpack!" );

    return false;
 }

 function onCallback0( tSock, targSerial )
 {
    var pUser = tSock.currentChar;
    var pName = pUser.name;
    var StrangeByte   = tSock.GetWord( 1 );
    var targX   = tSock.GetWord( 11 );
    var targY   = tSock.GetWord( 13 );
    var targZ   = tSock.GetSByte( 16 );
    var tileID   = tSock.GetWord( 17 );
   
    if( tileID == 0 )
    { //Target is a Maptile
       pUser.SysMessage("You cannot use necromantic mortar and pestle on that.");
    }
    else if( StrangeByte == 0 && targSerial.isChar )
    { //Target is a Character
       pUser.SysMessage("You cannot use necromantic mortar and pestle on that.");
    }
    else
    {
       var resourceType = 0;
       var resourceName = "";
       var bottleType = 0;
       var bottleName = "";
       var potionName = "";
       
       // Target is a Dynamic or Static Item
       if( tileID == 0x0f82 )
       {
          resourceType = 0x0f82;
          resourceName = "dragon's blood";
          bottleType = 0x0f0e;
          bottleName = "dragon's blood bottle";
          potionName = "dragonsbloodpotion";
       }
       else if( tileID == 0x0f78 )
       {
          resourceType = 0x0f78;
          resourceName = "batwing";
          bottleType = 0x0f0e;
          bottleName = "batwing bottle";
          potionName = "batwingpotion";
       }
       else if( tileID == 0x0f79 )
       {
          resourceType = 0x0f79;
          resourceName = "blackmoor";
          bottleType = 0x0f0e;
          bottleName = "blackmoor bottle";
          potionName = "blackmoorpotion";
       }
       else if( tileID == 0x0f7c )
       {
          resourceType = 0x0f7c;
          resourceName = "blood spawn";
          bottleType = 0x0f0e;
          bottleName = "bloodspawn bottle";
          potionName = "bloodspawnpotion";
       }
       else if( tileID == 0x0f7d )
       {
          resourceType = 0x0f7d;
          resourceName = "vial of blood";
          bottleType = 0x0f0e;
          bottleName = "vial of blood bottle";
          potionName = "vialofbloodpotion";
       }
       else if( tileID == 0x0f7e )
       {
          resourceType = 0x0f7e;
          resourceName = "bone";
          bottleType = 0x0f0e;
          bottleName = "bone bottle";
          potionName = "bonepotion";
       }
       else if( tileID == 0x0f7f )
       {
          resourceType = 0x0f7f;
          resourceName = "brimstone";
          bottleType = 0x0f0e;
          bottleName = "brimstone bottle";
          potionName = "brimstonepotion";
       }
       else if( tileID == 0x0f81 )
       {
          resourceType = 0x0f81;
          resourceName = "fertile dirt";
          bottleType = 0x0f0e;
          bottleName = "fertile dirt bottle";
          potionName = "fertiledirtpotion";
       }
       else if( tileID == 0x0f83 )
       {
          resourceType = 0x0f83;
          resourceName = "executioners cap";
          bottleType = 0x0f0e;
          bottleName = "executioner's cap bottle";
          potionName = "executionerscappotion";
       }
       else if( tileID == 0x0f83 )
       {
          resourceType = 0x0f83;
          resourceName = "eye of newt";
          bottleType = 0x0f0e;
          bottleName = "eye of newt bottle";
          potionName = "eyeofnewtpotion";
       }
       else if( tileID == 0x0f89 )
       {
          resourceType = 0x0f89;
          resourceName = "obsidian";
          bottleType = 0x0f0e;
          bottleName = "obsidian bottle";
          potionName = "obsidianpotion";
       }
       else if( tileID == 0x0f8a )
       {
          resourceType = 0x0f8a;
          resourceName = "pig iron";
          bottleType = 0x0f0e;
          bottleName = "pig iron bottle";
          potionName = "pigironpotion";
       }
       else if( tileID == 0x0f8b )
       {
          resourceType = 0x0f8b;
          resourceName = "pumice";
          bottleType = 0x0f0e;
          bottleName = "pumice bottle";
          potionName = "pumicepotion";
       }
       else if( tileID == 0x0f8e )
       {
          resourceType = 0x0f8e;
          resourceName = "seprent's scale";
          bottleType = 0x0f0e;
          bottleName = "serpent scale bottle";
          potionName = "serpentsscalepotion";
       }
       else if( tileID == 0x0f8f )
       {
          resourceType = 0x0f8f;
          resourceName = "volcanic ash";
          bottleType = 0x0f0e;
          bottleName = "volcanic ash bottle";
          potionName = "volcanicashpotion";
       }
       else if( tileID == 0x0f90 )
       {
          resourceType = 0x0f90;
          resourceName = "dead wood";
          bottleType = 0x0f0e;
          bottleName = "dead wood bottle";
          potionName = "deadwoodpotion";
       }
       else if( tileID == 0x0f91 )
       {
          resourceType = 0x0f91;
          resourceName = "wyrm's heart";
          bottleType = 0x0f0e;
          bottleName = "wyrm's heart bottle";
          potionName = "wyrmsheartpotion";
       }
   
       // Common stuff shared between all resourcetypes
       var iMakeResource = pUser.ResourceCount( bottleType ); // is there enough bottles to use up to make it
       if( iMakeResource > 0 )
       {
          if( resourceType )
          {
             var iMakeResource2 = pUser.ResourceCount( resourceType ); // is there enough resources to use up to make it
             if( iMakeResource2 > 0 )
             {
                pUser.UseResource( 1, resourceType ); // uses up a resource (amount, item ID, item colour)
                pUser.UseResource( 1, bottleType );
                   pUser.SoundEffect( 0x0246, true );
                   pUser.DoAction( 0x22 );
                   // check the skill
                   if( !pUser.CheckSkill( 13, 0, 300 ) )   // character to check, skill #, minimum skill, and maximum skill
                   {
                      pUser.SysMessage( "You are too afraid and spill the liquid all over you." );
                      return;
                   }
                   var itemMade = CreateDFNItem( pUser.socket, pUser, potionName, 1, "ITEM", true ); // makes the potion
                    pUser.SysMessage( "A bottle materializes to form around the liquid." );
                   pUser.EmoteMessage( pName+ " grinds the " +resourceName +" successfully into a potion." );
             }
             else
                pUser.SysMessage( "You don't seem to have any " +resourceName+ "!" );
          }
       }
       else
          pUser.SysMessage( "You don't seem to have an empty "+bottleName+"!" );
    }
}
Enjoy
Last edited by dragon slayer on Wed Dec 07, 2011 12:09 am, edited 3 times in total.
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Post by dragon slayer »

Update

got working potion script now
all you have to do is add this to the dfn items

SCRIPT=your#
MOREY=potion#
function onUseChecked( pUser, iUsed )
{
    var socket = pUser.socket;
        var pName = pUser.name;
    if( socket && iUsed && iUsed.isItem )
    {
        if( pUser.isUsingPotion )
        {
            socket.SysMessage( GetDictionaryEntry( 430, socket.Language ) ); //You must wait a while before using another potion.
            return false;
        }

        //Check to see if it's locked down
        if( iUsed.movable == 2 || iUsed.movable == 3 )
        {
            socket.SysMessage( GetDictionaryEntry( 774, socket.Language ) ); //That is locked down and you cannot use it
            return false;
        }
        switch( iUsed.morey )
        {
            case 1:     // Dragon's Blood
                pUser.StaticEffect( 0x373A, 0, 15 );
                pUser.SoundEffect( 0x0050, true );
                DoTempEffect( 0, pUser, pUser, 6, RandomNumber( 6, 15 ), 0, 0 );
                                DoTempEffect( 0, pUser, pUser, 8, (10 + RandomNumber( 1, 10 )), 0, 0 )
                                pUser.mana = (pUser.mana +20);
                pUser.isUsingPotion = true;
                                pUser.EmoteMessage( pName+ " feels the strength of a dragon inside you." );
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion              
                break;
            case 2:     // batwing
                pUser.StaticEffect( 0x373A, 0, 15 );
                pUser.SoundEffect( 0x0050, true );
                                DoTempEffect( 0, pUser, pUser, 6, RandomNumber( 20, 30 ), 0, 0 );
                                pUser.EmoteMessage( pName+ " feels the speed rush though his body" );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 3:     // Blackmoor Potion
                                pUser.health = (pUser.health -150);
                                pUser.EmoteMessage( pName+ " have been poisoned! your life's blood flows to a standstill as your heart stops beating." );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 4:     // Bloodspawn Potion
                pUser.health = (pUser.health + 25 + RandomNumber( 1, 5 ));
                                pUser.mana = (pUser.mana +25);
                pUser.StaticEffect( 0x376A, 0x09, 0x06 );
                pUser.SoundEffect( 0x01E3, true );
                                pUser.EmoteMessage( pName+ " feels his powers being replenished." );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 5:     // Vial of Blood Potion
                pUser.health = (pUser.health + 125 + RandomNumber( 1, 5 ));
                pUser.StaticEffect( 0x376A, 0x09, 0x06 );
                pUser.SoundEffect( 0x01E3, true );
                                pUser.EmoteMessage( pName+ " shoot the blood into his veins feeling his health return to him." );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 6:     // Bone Potion
                pUser.tempint=(pUser.tempint - 3);
                pUser.StaticEffect( 0x376A, 0x09, 0x06 );
                pUser.SoundEffect( 0x01E3, true );
                                pUser.EmoteMessage( pName+ " lose a few brain cells and get a small but insignificant high." );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 7:     // Brimstone Potion
                pUser.tempdex=(pUser.tempdex +1);
                pUser.StaticEffect( 0x376A, 0x09, 0x06 );
                pUser.SoundEffect( 0x01E3, true );
                                pUser.EmoteMessage( pName+ " feels lighter." );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 8:     // Fertile Dirt Potion
                pUser.tempdex=(pUser.tempdex +2);
                pUser.StaticEffect( 0x376A, 0x09, 0x06 );
                pUser.SoundEffect( 0x01E3, true );
                                pUser.EmoteMessage( pName+ " puts the dirt on the bottom of you feet, giving you more traction." );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 9:     // Executioner's Cap Potion
                pUser.tempstr=(pUser.tempstr +2);
                pUser.StaticEffect( 0x376A, 0x09, 0x06 );
                pUser.SoundEffect( 0x01E3, true );
                                pUser.EmoteMessage( pName+ " place the cap over his head, and notice his muscles bulge slightly." );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 10:        // Eye of Newt Potion
                pUser.tempint=(pUser.tempint +1);
                pUser.StaticEffect( 0x376A, 0x09, 0x06 );
                pUser.SoundEffect( 0x01E3, true );
                                pUser.EmoteMessage( "The newt's eye assimilates into braincells and enters your brain." );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 11:        // Obsidian Potion
                                pUser.stamina = (pUser.stamina -50);
                pUser.StaticEffect( 0x376A, 0x09, 0x06 );
                pUser.SoundEffect( 0x01E3, true );
                                pUser.EmoteMessage( "The rock substance settles heavily into your stomach, slowing you down for the time being." );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 12:        // Pig Iron Potion
                                pUser.stamina = (pUser.stamina -50);
                                pUser.health = (pUser.health -50);
                                pUser.mana = (pUser.mana -50);
                pUser.StaticEffect( 0x376A, 0x09, 0x06 );
                pUser.SoundEffect( 0x01E3, true );
                                pUser.EmoteMessage( "You recieve lead poisoning." );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 13:        // Pumice Potion
                                // working on this still
                pUser.StaticEffect( 0x376A, 0x09, 0x06 );
                pUser.SoundEffect( 0x01E3, true );
                                pUser.EmoteMessage( "You recieve an awesome trip in which time you make a trip to your bank." );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 14:        // Serpent's Scale Potion
                pUser.tempdex=(pUser.tempdex -5);
                pUser.StaticEffect( 0x376A, 0x09, 0x06 );
                pUser.SoundEffect( 0x01E3, true );
                                pUser.EmoteMessage( "You absently swallow the potion and notice nothing immediately." );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 15:        // Dead Wood Potion
                pUser.tempint=(pUser.tempint -5);
                pUser.StaticEffect( 0x376A, 0x09, 0x06 );
                pUser.SoundEffect( 0x01E3, true );
                                pUser.EmoteMessage( "Your mind drifts away as the wood dissipates in your stomach." );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 16:        // Wyrm's Heart Potion
                                pUser.stamina = (pUser.stamina +50);
                                pUser.health = (pUser.health +50);
                                pUser.mana = (pUser.mana +50);
                pUser.StaticEffect( 0x376A, 0x09, 0x06 );
                pUser.SoundEffect( 0x01E3, true );
                                pUser.EmoteMessage( "The wyrm's heart empowers your own returning lost vigor." );
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            case 17:        // Volcanic Ash Potion
                                pUser.health = (pUser.health -30);
                pUser.StaticEffect( 0x376A, 0x09, 0x06 );
                pUser.SoundEffect( 0x01E3, true );
                                pUser.EmoteMessage( "You drink the potion and your body starts to burn." );
                            var nSpawned = SpawnNPC( "necrofireelemental", pUser.x, pUser.y, pUser.z, pUser.worldnumber );
                            if( nSpawned == null )
                            {
                               pUser.SysMessage( "Creature couldn't be created." );
                               return;
                            }
                            nSpawned.owner = pUser;  
                pUser.isUsingPotion = true;
                DoTempEffect( 0, pUser, pUser, 26, 0, 0, 0 ); //Disallow immediately using another potion
                break;
            default:
                break;
        }

        if( iUsed.morey != 3 )
        {
            pUser.SoundEffect( 0x0030, true );
            if( pUser.id > 0x0189 && !pUser.isonhorse )
                pUser.DoAction( 0x22 );

            iUsed.Delete();

            var eBottle = CreateBlankItem( socket, pUser, 1, "#", 0x0F0E, 0, "ITEM", true );
            if( eBottle && eBottle.isItem )
                eBottle.decay = true;
        }
    }
    return false;
}

function onCallback0( socket, ourObj )
{
    var mChar = socket.currentChar;
    var iUsed = socket.tempObj;
    if( mChar && mChar.isChar && iUsed && iUsed.isItem )
    {
        iUsed.container = null;
        // We need a LineOfSight check
        var StrangeByte = socket.GetWord( 1 );
        if( StrangeByte == 0 && ourObj )
            iUsed.Teleport( ourObj );
        else
        {
            var x = socket.GetWord( 11 );
            var y = socket.GetWord( 13 );
            var z = socket.GetSByte( 16 ) + GetTileHeight( socket.GetWord( 17 ) );
            iUsed.Teleport( x, y, z );
        }

        iUsed.movable = 2;
        DoMovingEffect( mChar, iUsed, 0x0F0D, 0x11, 0, false, 0, 0 );
    }
}
and add this npc to your custom npcs
[necrofireelemental]
{
NAME=a fire elemental
ID=0x000f
SKIN=0000
DIRECTION=N
BACKPACK
STR=125 155
DEX=165 185
INT=71 95
HPMAX=125 155
KARMA=-6000
FAME=6000
MAGICRESISTANCE=600 750
TACTICS=800 1000
WRESTLING=700 1000
DAMAGE=4 12
DEF=20
SPATTACK=6176
SPADELAY=10
MAGERY=600 750
NPCWANDER=4
FX1=-1
FY1=-1
FZ1=-1
FX2=20
TOTAME=110
RACE=14
FLAG=NEUTRAL
}
Post Reply