Full Version : Help needed in getting Harrower to drop an item
xmlspawner >>Scripting Support >>Help needed in getting Harrower to drop an item


<< Prev | Next >>

Dave1969- 07-27-2006
Hey guys, I made a deed that allows for a gm to add one follower to a player. Im trying to get them to dro[ on the Harrower. I added the line in the harrower.cs like i would any other mob to drop something but when i go to test it his corpse is empty. ALl i want is them to drop on his body and dont know why it wont work

Odee- 07-27-2006
Im taking it your using 1.0. Ill give you two examples.

\\\ Random Drop ///

CODE
 switch ( Utility.Random( 15 ) )
 {
  case 0: PackItem( new Bracers() ); break;
  case 1: PackItem( new Chest() ); break;
  case 2: PackItem( new Choker() ); break;
  case 3: PackItem( new FemaleChest() ); break;
  case 4: PackItem( new Headdress() ); break;
  case 5: PackItem( new Leggings() ); break;
  case 6: PackItem( new Sleeves() ); break;
 }


If Im right there is a 15% chance one of the following will drop (or 1 out of 15, I cant remember how it works).

\\\ New Pack Item ///

CODE
}

  PackItem( new Log( Utility.RandomMinMax( 23, 34 ) ) );
 }


The above is showing what the Mobile will drop, just at a random number between 23 and 34 (possible to drop 23 and 34). This is for stackable items...we dont want that. We want something like this:

CODE

PackItem( new YourItemHere )));


OR if that doesnt work

CODE

AddLoot( LootPack.YourItemHere, X );


Where X = the desired amount to drop.

Hope this helps. If it doesnt work, post your code.




Haazen- 07-27-2006
Another thing to consider, If the item is blessed, it will not show up in the corpse. If it is blessed, you need to drop it a bit different. Here is an example:

CODE
 public override void OnDeath( Container c )
 {

  if ( Utility.RandomDouble() <= 0.25 )
   c.DropItem( new EvoMercDeed() );
  base.OnDeath( c );
 }


This drops our blessed EvoMercDeed 25% of the time. You can also add the Switch examples as before into this OnDeath method if needed.

Dave1969- 07-28-2006
Omg thanks guys for all your inout. I totally forgot about the blessed item not dropping. I deleted the blessed line in my deed.cs and all works great. Thanks again