229 lines
11 KiB
Plaintext
229 lines
11 KiB
Plaintext
|
void CreateAnObject(string sResource, object oPC, int iStackSize);
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
object oPC = GetLastDisturbed();
|
||
|
object oItem = GetInventoryDisturbItem();
|
||
|
string sItemTag = GetTag(oItem);
|
||
|
string sSuccess = "";
|
||
|
|
||
|
// The following 3 lines are to ensure compatability with UOAbigal's Persistent Token System.
|
||
|
// You can replace them with whatever 'no-drop' code you have or comment them out.
|
||
|
string sNoDropFlag = (GetStringLeft(GetTag(oItem),6));
|
||
|
if (sNoDropFlag == "NoDrop" || sNoDropFlag == "TOKEN_"||sNoDropFlag=="_TBOX_")
|
||
|
return;
|
||
|
if (GetBaseItemType(oItem)==BASE_ITEM_LARGEBOX)
|
||
|
{
|
||
|
DestroyObject(oItem);
|
||
|
SendMessageToPC(oPC,"To avoid possible dupe exploits, the container placed in this bag may be destroyed.");
|
||
|
return;
|
||
|
}
|
||
|
// End of compatability portion.
|
||
|
|
||
|
|
||
|
|
||
|
if (GetStringLeft(sItemTag,9)!="GEMSTONE_")
|
||
|
{
|
||
|
CopyItem(oItem,oPC,TRUE);
|
||
|
FloatingTextStringOnCreature("This is not a gemstone...",oPC,FALSE);
|
||
|
DestroyObject(oItem);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
if (GetLocalInt(OBJECT_SELF,"iAmInUse")!=0)
|
||
|
{
|
||
|
CopyItem(oItem,oPC,TRUE);
|
||
|
FloatingTextStringOnCreature("The mineral bath is not yet ready for more gemstones...",oPC,FALSE);
|
||
|
DestroyObject(oItem);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
object oAcid = GetItemPossessedBy(oPC,"ACID_WEAK");
|
||
|
if (oAcid == OBJECT_INVALID)
|
||
|
{
|
||
|
CopyItem(oItem,oPC,TRUE);
|
||
|
DestroyObject(oItem);
|
||
|
FloatingTextStringOnCreature("You must have some weak acid in order to activate the mineral bath.",oPC,FALSE);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
int iAcidStack = GetNumStackedItems(oAcid)-1;
|
||
|
DestroyObject(oAcid);
|
||
|
if (iAcidStack >0) DelayCommand(1.0,CreateAnObject("acid001",oPC,iAcidStack));
|
||
|
string sGemResRef = "";
|
||
|
|
||
|
if (sItemTag =="GEMSTONE_ORNAMENTAL")
|
||
|
{
|
||
|
switch (d12(1))
|
||
|
{
|
||
|
case 1:{sGemResRef = "azurite001";sSuccess="azurite";break;}
|
||
|
case 2:{sGemResRef = "bandedagate001";sSuccess="banded agate";break;}
|
||
|
case 3:{sGemResRef = "bluequartz001";sSuccess="blue quartz";break;}
|
||
|
case 4:{sGemResRef = "eyeagate001";sSuccess="eye agate";break;}
|
||
|
case 5:{sGemResRef = "hematite001";sSuccess="hematite";break;}
|
||
|
case 6:{sGemResRef = "lapislazuli001";sSuccess="lapis lazuli";break;}
|
||
|
case 7:{sGemResRef = "malachite001";sSuccess="malachite";break;}
|
||
|
case 8:{sGemResRef = "mossagate001";sSuccess="moss agate";break;}
|
||
|
case 9:{sGemResRef = "obsidian001";sSuccess="obsidian";break;}
|
||
|
case 10:{sGemResRef = "rhodochrosite001";sSuccess="rhodochrosite";break;}
|
||
|
case 11:{sGemResRef = "tigereye001";sSuccess="tiger eye";break;}
|
||
|
default:{sGemResRef = "turquoise001";sSuccess="turquoise";break;}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (sItemTag =="GEMSTONE_SEMIPRECIOUS")
|
||
|
{
|
||
|
switch (Random(13))
|
||
|
{
|
||
|
case 1:{sGemResRef = "bloodstone001";sSuccess="bloodstone";break;}
|
||
|
case 2:{sGemResRef = "carnelian001";sSuccess="carnelian";break;}
|
||
|
case 3:{sGemResRef = "chalcendony001";sSuccess="chalcendony";break;}
|
||
|
case 4:{sGemResRef = "chrysoprase001";sSuccess="chrysoprase";break;}
|
||
|
case 5:{sGemResRef = "citrine001";sSuccess="citrine";break;}
|
||
|
case 6:{sGemResRef = "jasper001";sSuccess="jasper";break;}
|
||
|
case 7:{sGemResRef = "moonstone001";sSuccess="moonstone";break;}
|
||
|
case 8:{sGemResRef = "onyx001";sSuccess="onyx";break;}
|
||
|
case 9:{sGemResRef = "rockcrystal001";sSuccess="rock crystal";break;}
|
||
|
case 10:{sGemResRef = "sardonyx001";sSuccess="sardonyx";break;}
|
||
|
case 11:{sGemResRef = "smokyquartz001";sSuccess="smoky quartz";break;}
|
||
|
case 12:{sGemResRef = "zircon001";sSuccess="zircon";break;}
|
||
|
default:{sGemResRef = "starrosequart001";sSuccess="star rose quartz";break;}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (sItemTag =="GEMSTONE_FANCY")
|
||
|
{
|
||
|
switch (Random(11))
|
||
|
{
|
||
|
case 1:{sGemResRef = "amber001";sSuccess="amber";break;}
|
||
|
case 2:{sGemResRef = "alexandrite001";sSuccess="alexandrite";break;}
|
||
|
case 3:{sGemResRef = "amethyst001";sSuccess="amethyst";break;}
|
||
|
case 4:{sGemResRef = "chrysoberyl001";sSuccess="chrysoberyl";break;}
|
||
|
case 5:{sGemResRef = "coral001";sSuccess="coral";break;}
|
||
|
case 6:{sGemResRef = "garnetsmall001";sSuccess="red garnet";break;}
|
||
|
case 7:{sGemResRef = "jade001";sSuccess="jade";break;}
|
||
|
case 8:{sGemResRef = "jet001";sSuccess="jet";break;}
|
||
|
case 9:{sGemResRef = "whitepearl001";sSuccess="white pearl";break;}
|
||
|
case 10:{sGemResRef = "spinel001";sSuccess="red spinel";break;}
|
||
|
default:{sGemResRef = "tourmaline001";sSuccess="tourmaline";break;}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (sItemTag =="GEMSTONE_PRECIOUS")
|
||
|
{
|
||
|
switch (d6(1))
|
||
|
{
|
||
|
case 1:{sGemResRef = "aquamarine001";sSuccess="aquamarine";break;}
|
||
|
case 2:{sGemResRef = "garnetviolet001";sSuccess="violet garnet";break;}
|
||
|
case 3:{sGemResRef = "blackpearl001";sSuccess="black pearl";break;}
|
||
|
case 4:{sGemResRef = "peridot001";sSuccess="peridot";break;}
|
||
|
case 5:{sGemResRef = "bluespinel001";sSuccess="blue spinel";break;}
|
||
|
default:{sGemResRef = "topaz001";sSuccess="topaz";break;}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (sItemTag =="GEMSTONE_GEM")
|
||
|
{
|
||
|
switch (Random(9))
|
||
|
{
|
||
|
case 1:{sGemResRef = "blackopal001";sSuccess="black opal";break;}
|
||
|
case 2:{sGemResRef = "emerald001";sSuccess="emerald";break;}
|
||
|
case 3:{sGemResRef = "fireopal001";sSuccess="fire opal";break;}
|
||
|
case 4:{sGemResRef = "opal001";sSuccess="opal";break;}
|
||
|
case 5:{sGemResRef = "orientalameth001";sSuccess="oriental emerald";break;}
|
||
|
case 6:{sGemResRef = "orientaltopaz001";sSuccess="oriental topaz";break;}
|
||
|
case 7:{sGemResRef = "sapphire001";sSuccess="sapphire";break;}
|
||
|
case 8:{sGemResRef = "starruby001";sSuccess="star ruby";break;}
|
||
|
default:{sGemResRef = "starsapphire001";sSuccess="star sapphire";break;}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (sItemTag =="GEMSTONE_JEWEL")
|
||
|
{
|
||
|
switch (Random(5))
|
||
|
{
|
||
|
case 1:{sGemResRef = "blacksapphire001";sSuccess="black sapphire";break;}
|
||
|
case 2:{sGemResRef = "diamond001";sSuccess="diamond";break;}
|
||
|
case 3:{sGemResRef = "jacinth001";sSuccess="jacinth";break;}
|
||
|
case 4:{sGemResRef = "orientalemera001";sSuccess="oriental emerald";break;}
|
||
|
default:{sGemResRef = "ruby001";sSuccess="ruby";break;}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
sSuccess = "The mineral bath revelas the gemstone to be "+sSuccess+".";
|
||
|
|
||
|
// This snippet of code is cut-n-paste direct from ATS
|
||
|
// Reason for this is because I had no clue how to assign an increase
|
||
|
// in the z-axis of the location of the anvil for sparks to display.
|
||
|
// After reading through this code, it is obvious that vEffecrPos.z
|
||
|
// is the line which assigns this. Due to my own ignorance in this issue
|
||
|
// I have decided to leave this snippet of code intact with this credit to
|
||
|
// the original ATS script coders, whomever they may have been.
|
||
|
//The only modification to this code is locAnvil was changed to locBath.
|
||
|
|
||
|
location locBath = GetLocation(OBJECT_SELF);
|
||
|
vector vEffectPos = GetPositionFromLocation(locBath);
|
||
|
vEffectPos.z += 1.0;
|
||
|
location locEffect = Location( GetAreaFromLocation(locBath), vEffectPos,GetFacingFromLocation(locBath) );
|
||
|
// End snippet
|
||
|
|
||
|
ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), locEffect);
|
||
|
ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_HIT_FIRE), locEffect);
|
||
|
DelayCommand(0.2,PlaySound("as_cv_smithwatr1"));
|
||
|
DelayCommand(0.5,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPECIAL_RED_WHITE), locEffect));
|
||
|
DelayCommand(1.0,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_HIT_ACID), locEffect));
|
||
|
DelayCommand(1.5,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPARKS_PARRY), locEffect));
|
||
|
DelayCommand(1.8,PlaySound("al_cv_firepot1"));
|
||
|
DelayCommand(2.0,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), locEffect));
|
||
|
DelayCommand(2.5,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPECIAL_WHITE_BLUE), locEffect));
|
||
|
DelayCommand(3.0,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPECIAL_RED_WHITE), locEffect));
|
||
|
DelayCommand(3.5,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPARKS_PARRY), locEffect));
|
||
|
DelayCommand(4.0,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), locEffect));
|
||
|
DelayCommand(4.5,PlaySound("as_na_steamshrt2"));
|
||
|
DelayCommand(5.5,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPECIAL_BLUE_RED), locEffect));
|
||
|
DelayCommand(5.0,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_HIT_ACID), locEffect));
|
||
|
DelayCommand(5.5,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPARKS_PARRY), locEffect));
|
||
|
DelayCommand(6.0,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), locEffect));
|
||
|
DelayCommand(6.5,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPECIAL_RED_ORANGE), locEffect));
|
||
|
DelayCommand(7.0,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPECIAL_WHITE_BLUE), locEffect));
|
||
|
DelayCommand(7.2,PlaySound("as_na_steamshrt1"));
|
||
|
DelayCommand(7.5,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPARKS_PARRY), locEffect));
|
||
|
DelayCommand(8.0,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), locEffect));
|
||
|
DelayCommand(8.5,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_HIT_ACID), locEffect));
|
||
|
DelayCommand(9.0,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPECIAL_BLUE_RED), locEffect));
|
||
|
DelayCommand(9.5,ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPARKS_PARRY), locEffect));
|
||
|
|
||
|
|
||
|
DestroyObject(oItem);
|
||
|
int iNum = d6(3)/3;
|
||
|
ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE,1.0,9.6);
|
||
|
DelayCommand(9.7,ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE,1.0,10.0));
|
||
|
|
||
|
AssignCommand(oPC,PlaySound("as_cv_potclang1"));
|
||
|
AssignCommand(oPC,DelayCommand(0.2,ActionPlayAnimation(ANIMATION_LOOPING_GET_MID,1.0,9.5)));
|
||
|
AssignCommand(oPC,DelayCommand(9.5,CreateAnObject(sGemResRef,oPC,iNum)));
|
||
|
AssignCommand(oPC,DelayCommand(8.0,FloatingTextStringOnCreature(sSuccess,oPC,FALSE)));
|
||
|
if (iNum>1)
|
||
|
{
|
||
|
AssignCommand(oPC,DelayCommand(10.0,FloatingTextStringOnCreature("The mineral bath reveals "+IntToString(iNum)+" gems.",oPC,FALSE)));
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
AssignCommand(oPC,DelayCommand(10.0,FloatingTextStringOnCreature("The mineral bath reveals a single gem.",oPC,FALSE)));
|
||
|
}
|
||
|
|
||
|
SetLocalInt(OBJECT_SELF,"iAmInUse",99);
|
||
|
DelayCommand(10.0,SetLocalInt(OBJECT_SELF,"iAmInUse",0));
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
void CreateAnObject(string sResource, object oPC, int iStackSize)
|
||
|
{
|
||
|
CreateItemOnObject(sResource,oPC,iStackSize);
|
||
|
return;
|
||
|
}
|