EDIT: script fixed.
Script Name: DeathSpawn
What it Does: This script can be used to fire off random generation of
treasure, random visual effect, and even random "famous last words".
It's origional intent was to spawn up to 3 predefined magic items using
CreateObject (Still haven't figured that one out yet) to drop when the
creature dies. This is a userdefined event triggered by the ondeath
event.
NWScript: void main()
{
int nUser = GetUserDefinedEventNumber();
if(nUser == 1007)
{
int iChance = d100( );
int iItem1, iItem2, iItem3, iITEM;
int iCheck = 0;
int iItemsDropped = 0;
int i;
if(iChance >= 90)
iItemsDropped = 3;
else if(iChance >= 50)
iItemsDropped = 2;
else
iItemsDropped =1;
iItem1 = d8(1);
iITEM = iItem1;
iItem2 = d8(1);
iItem3 = d8(1);
for(i = 1; i <= iItemsDropped; i++)
{
if (iCheck == 2){
iITEM = iItem3;
}
if(iCheck == 1){
iITEM = iItem2;
iCheck =2;
}
if (iCheck == 0){
while(iITEM == iItem2 || iITEM == iItem3 || iItem2 == iItem3){
iItem2 = d8( );
iItem3 = d8( );
}
iCheck = 1;
}
switch(iITEM){
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
}
}
}
}
_________________
Fianna Tiger - And the tigers come at night, their voice as soft as
thunder. They tear your dreams apart they turn your life to shame.
|