A preview of Necro Book

Need help with your JScripts? Got questions concerning the DFNs? Come forward, step inside :)
Post Reply
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

A preview of Necro Book

Post by dragon slayer »

This just 8 spells i have done. BUt just a preview of what I'm working on. still 8 more spells to do :)

plus first 8 spells still need work but i wanted to get the hype up.

maybe give people idea how to create there own spells and so forth

Code: Select all

function onUseChecked ( pUser, iUsed ) 
{ 
  var socket = pUser.socket;
  socket.tempObj = iUsed;
  if( iUsed.container != null ) 
  {
       var necroGump = new Gump;
            necroGump.AddPage(0);
            necroGump.AddGump( 30, 30, 2200 );
	    necroGump.AddText( 70, 40, 31, "Lesser Chants" );
	    necroGump.AddText( 230, 40, 31, "Greater Chants" );
	    necroGump.AddButton( 60, 70, 0x837, 1, 0, 1 );
	    necroGump.AddText( 80, 65, 0, "Negate Hunger" );
	    necroGump.AddButton( 60, 90, 0x837, 1, 0, 2 );
	    necroGump.AddText( 80, 85, 0, "Life Focus" );
	    necroGump.AddButton( 60, 110, 0x837, 1, 0, 3 );
	    necroGump.AddText( 80, 105, 0, "Restoration" );
	    necroGump.AddButton( 60, 130, 0x837, 1, 0, 4 );
	    necroGump.AddText( 80, 125, 0, "Control Undead" );
	    necroGump.AddButton( 60, 150, 0x837, 1, 0, 5 );
	    necroGump.AddText( 80, 145, 0, "Animate Dead" );
	    necroGump.AddButton( 60, 170, 0x837, 1, 0, 6 );
	    necroGump.AddText( 80, 165, 0, "Bone Armor" );
	    necroGump.AddButton( 60, 190, 0x837, 1, 0, 7 );
	    necroGump.AddText( 80, 185, 0, "Chill Touch" );
	    necroGump.AddButton( 60, 210, 0x837, 1, 0, 8 );
	    necroGump.AddText( 80, 205, 0, "Raise Dead" );
	    necroGump.AddButton( 220, 70, 0x837, 1, 0, 0 );
	    necroGump.AddText( 240, 65, 0, "Ghoul's Touch" );
	    necroGump.AddButton( 220, 90, 0x837, 1, 0, 0 );
	    necroGump.AddText( 240, 85, 0, "Plague" );
	    necroGump.AddButton( 220, 110, 0x837, 1, 0, 0 );
	    necroGump.AddText( 240, 105, 0, "Summon Spirit" );
	    necroGump.AddButton( 220, 130, 0x837, 1, 0, 0 );
	    necroGump.AddText( 240, 125, 0, "Vamparic Touch" );
	    necroGump.AddButton( 220, 150, 0x837, 1, 0, 0 );
	    necroGump.AddText( 240, 145, 0, "Spirit Wrack" );
	    necroGump.AddButton( 220, 170, 0x837, 1, 0, 0 );
	    necroGump.AddText( 240, 165, 0, "Wraith Form" );
	    necroGump.AddButton( 220, 190, 0x837, 1, 0, 0 );
	    necroGump.AddText( 240, 185, 0, "Undead Army" );
	    necroGump.AddButton( 220, 210, 0x837, 1, 0, 0 );
	    necroGump.AddText( 240, 205, 0, "Undead Champion" );
            necroGump.Send( pUser ); // send this gump to client now 
            necroGump.Free(); // clear this gump from uox-memory 
            return false; 
   } 
   else 
   pUser.SysMessage( "That must be in your pack for you to use it." ); 
    return false; 
}

function onGumpPress( pSock, pButton, gumpData )
{
	var iUsed = pSock.tempObj;
	var pUser = pSock.currentChar;
        var batwing = pUser.ResourceCount( 0x0f78 );
        var blackmoore = pUser.ResourceCount( 0x0f79 );
        var bloodspawn = pUser.ResourceCount( 0x0f7c );
        var bone = pUser.ResourceCount( 0x0f7e );
        var brimstone = pUser.ResourceCount( 0x0f7f );
	switch(pButton)
	{
		case 0:// abort and do nothing
		       break;
		case 1:if( pUser.CheckSkill( 49, 0, 1000 ) ) 
                       {       
                          if ( batwing < 3 )
                          { 
                             pUser.SysMessage( "Not enough bat wing." ); break;
                          }
                          if ( batwing > 3 )
                          {
                             pUser.DoAction( 17 );
                             pUser.StartTimer( 800, 1, true );
                             pUser.UseResource( 3,  0x0f78 );
                             pUser.mana = (pUser.mana -3);
                             break;
                          }
                          else
                             pUser.SysMessage( "You fail to cast the spell." );
                             pUser.StaticEffect( 0x3735, 0, 15 );
                             pUser.SoundEffect( 0x56D, true );
                             break; 
                       } 
		case 2:if( pUser.CheckSkill( 49, 0, 1000 ) ) 
                       { 
                          if ( blackmoore < 3 )
                          { 
                             pUser.SysMessage( "Not enough blackmoore." ); break;
                          }
                          if ( blackmoore > 3 )
                          {
                             pUser.DoAction( 17 );
                             pUser.StartTimer( 800, 2, true );
                             pUser.UseResource( 3,  0x0f79 );
                             pUser.mana = (pUser.mana -3);
                             break;
                          }
                          else
                             pUser.SysMessage( "You fail to cast the spell." );
                             pUser.StaticEffect( 0x3735, 0, 15 );
                             pUser.SoundEffect( 0x56D, true );
                             break;
                       }
		case 3:if( pUser.CheckSkill( 49, 0, 1000 ) ) 
                       { 
                          if ( bloodspawn < 3 )
                          { 
                             pUser.SysMessage( "Not enough bloodspawn." ); break;
                          }
                          if ( bloodspawn > 3 )
                          {
                             pUser.DoAction( 17 );
                             pUser.StartTimer( 800, 3, true );
                             pUser.UseResource( 3,  0x0f7c );
                             pUser.mana = (pUser.mana -3);
                             break;
                          }
                          else
                             pUser.SysMessage( "You fail to cast the spell." );
                             pUser.StaticEffect( 0x3735, 0, 15 );
                             pUser.SoundEffect( 0x56D, true );
                             break;
                       }
		case 4:if( pUser.CheckSkill( 49, 300, 1000 ) ) 
                       { 
                          if ( bone < 4 )
                          { 
                             pUser.SysMessage( "Not enough bat wing." ); break;
                          }
                          if ( bone > 4 )
                          {
                             pUser.DoAction( 17 );
                             pUser.StartTimer( 800, 4, true );
                             pUser.UseResource( 4,  0x0f7f );
                             pUser.mana = (pUser.mana -4);
                             break;
                          }
                          else
                             pUser.SysMessage( "You fail to cast the spell." );
                             pUser.StaticEffect( 0x3735, 0, 15 );
                             pUser.SoundEffect( 0x56D, true );
                             break;
                       }
		case 5:if( pUser.CheckSkill( 49, 400, 1000 ) ) 
                       { 
                          if ( brimstone < 4 )
                          { 
                             pUser.SysMessage( "Not enough bat wing." ); break;
                          }
                          if ( brimstone > 4 )
                          {
                             pUser.DoAction( 17 );
                             pUser.StartTimer( 800, 5, true );
                             pUser.UseResource( 4,  0x0f78 );
                             pUser.mana = (pUser.mana -4);
                             break;
                          }
                          else
                             pUser.SysMessage( "You fail to cast the spell." );
                             pUser.StaticEffect( 0x3735, 0, 15 );
                             pUser.SoundEffect( 0x56D, true );
                             break;
                       }
		case 6:if( pUser.CheckSkill( 49, 500, 1000 ) ) 
                       { 
                          if ( batwing < 3 )
                          { 
                             pUser.SysMessage( "Not enough bat wing." ); break;
                          }
                          if ( batwing > 3 )
                          {
                             pUser.DoAction( 17 );
                             pUser.StartTimer( 800, 6, true );
                             pUser.UseResource( 3,  0x0f78 );
                             pUser.mana = (pUser.mana -3);
                             break;
                          }
                          else
                             pUser.SysMessage( "You fail to cast the spell." );
                             pUser.StaticEffect( 0x3735, 0, 15 );
                             pUser.SoundEffect( 0x56D, true );
                             break;
                       }
		case 7:if( pUser.CheckSkill( 49, 550, 1000 ) ) 
                       { 
                          if ( batwing < 3 )
                          { 
                             pUser.SysMessage( "Not enough bat wing." ); break;
                          }
                          if ( batwing > 3 )
                          {
                             pUser.DoAction( 17 );
                             pUser.StartTimer( 800, 7, true );
                             pUser.UseResource( 3,  0x0f78 );
                             pUser.mana = (pUser.mana -3);
                             break;
                          }
                          else
                             pUser.SysMessage( "You fail to cast the spell." );
                             pUser.StaticEffect( 0x3735, 0, 15 );
                             pUser.SoundEffect( 0x56D, true );
                             break;
                       }
		case 8:if( pUser.CheckSkill( 49, 650, 1000 ) ) 
                       { 
                          if ( batwing < 3 )
                          { 
                             pUser.SysMessage( "Not enough bat wing." ); break;
                          }
                          if ( batwing > 3 )
                          {
                             pUser.DoAction( 17 );
                             pUser.StartTimer( 800, 8, true );
                             pUser.UseResource( 3,  0x0f78 );
                             pUser.mana = (pUser.mana -3);
                             break;
                          }
                          else
                             pUser.SysMessage( "You fail to cast the spell." );
                             pUser.StaticEffect( 0x3735, 0, 15 );
                             pUser.SoundEffect( 0x56D, true );
                             break;
                       }
	}
}

function onTimer( pUser, timerID ) 
{ 
   var socket = pUser.socket;
   if( timerID == 1 )
   {
      pUser.StaticEffect( 0x373A, 0, 15 );
      pUser.SoundEffect( 0x1FB, true );
      var itemMade = CreateDFNItem( pUser.socket, pUser, "listobject72", 1, "ITEM", true );
   }
   if( timerID == 2 )
   {
      pUser.StaticEffect( 0x373A, 0, 15 );
      pUser.SoundEffect( 0x1FB, true );
      pUser.SetPoisoned( 0, 0 );
   }
   if( timerID == 3 )
   {
     socket.CustomTarget(0);
   }
   if( timerID == 4 )
   {
     socket.CustomTarget(1);
   }
   if( timerID == 5 )
   {
     socket.CustomTarget(3);
   }
   if( timerID == 6 )
   {
      pUser.StaticEffect( 0x373A, 0, 15 );
      pUser.SoundEffect( 0x1FB, true );
      var itemMade = CreateDFNItem( pUser.socket, pUser, "listobject84", 1, "ITEM", true );
   }
   if( timerID == 7 )
   {
     socket.CustomTarget(2);
   }
   if( timerID == 8 )
   {
      pUser.StaticEffect( 0x373A, 0, 15 );
      pUser.SoundEffect( 0x1FB, true );
      var nSpawned = SpawnNPC( "skeleton", pUser.x, pUser.y, pUser.z, pUser.worldnumber );
      if( nSpawned )
      {
         nSpawned.owner = pUser;
         nSpawned.aitype = 0;
         nSpawned.Follow( pUser );
         nSpawned.wandertype = 1;
      }
  
   }
   if( timerID == 22 )
   {
      pUser.SysMessage( "You are no longer frozen" );
      pUser.frozen = 0;
   }
}

function onCallback0( socket, myTarget)
{
	var pUser = socket.currentChar;
	var iUsed = socket.tempObj;

	if( !socket.GetWord( 1 ) && myTarget.isChar )
	{
		if( pUser.InRange( myTarget, 12 ))
		{
                  myTarget.SysMessage( "All of you stats have been restored" );
                  myTarget.stamina = (myTarget.stamina +10);
                  myTarget.mana = (myTarget.mana +10);
                  myTarget.health = (myTarget.health +10);
                  myTarget.StaticEffect( 0x373A, 0, 15 );
                  myTarget.SoundEffect( 0x1FB, true );
		}
		else
			pUser.SysMessage( "Your target is out of range." );
	}
	else
		pUser.SysMessage( "You cannot target that." );
}

function onCallback1( socket, myTarget)
{
	var pUser = socket.currentChar;
	var iUsed = socket.tempObj;

	if( myTarget.id == 0x32 || myTarget.id == 0x38 || myTarget.id == 0x03)
	{
		if( pUser.InRange( myTarget, 12 ))
		{
                  if( myTarget.owner == pUser)
                  {
                     pUser.SysMessage( "That Undead is being controlled already" );
		     return;
                  }
                  else if( myTarget.owner == null)
                  {
                     myTarget.owner = pUser;
                     myTarget.Follow( pUser );
		     return;
                  }
		}
		else
			pUser.SysMessage( "Your target is out of range." );
	}
	else
		pUser.SysMessage( "That is not Undead" );
}

function onCallback2( socket, myTarget)
{
	var pUser = socket.currentChar;
	var iUsed = socket.tempObj;

	if( !socket.GetWord( 1 ) && myTarget.isChar )
	{
		if( pUser.InRange( myTarget, 12 ))
		{
                  myTarget.SysMessage( "You feel the cold run though your body." );
                  myTarget.frozen = 1;
                  myTarget.StaticEffect( 0x373A, 0, 15 );
                  myTarget.SoundEffect( 0x1FB, true );
                  myTarget.StartTimer( 5000, 22, true );
		}
		else
			pUser.SysMessage( "Your target is out of range." );
	}
	else
		pUser.SysMessage( "You cannot target that." );
}

function onCallback3( socket, myTarget)
{
	var pUser = socket.currentChar;
	var iUsed = socket.tempObj;

		if( pUser.InRange( myTarget, 12 ))
		{
                  CarveCorpse( socket, pUser, myTarget );
		}
		else
			pUser.SysMessage( "Your target is out of range." )
}

function CarveCorpse( socket, mChar, ourObj )
{
	if( mChar.InRange( ourObj, 3 ) )
	{
            var nSpawned = SpawnNPC( "skeleton", mChar.x, mChar.y,mChar.z, mChar.worldnumber );
            mChar.SoundEffect( 0x1FB, true );
            ourObj.Delete();
	}
	else
		socket.SysMessage( GetDictionaryEntry( 393, socket.Language ) );
}
Post Reply