2024-06-14 10:48:20 -04:00
|
|
|
//#include "_persist_01a"
|
|
|
|
#include "nw_i0_plot"
|
|
|
|
|
|
|
|
void CreateAnObject(string sResource, object oPC);
|
|
|
|
object CreatePlaceable(string sObject, location lPlace, float fDuration);
|
|
|
|
void GetNextItemPossessedBy(object oPC, string sItemTag);
|
|
|
|
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
int iAdded = 0;
|
|
|
|
if (GetInventoryDisturbType()!= INVENTORY_DISTURB_TYPE_ADDED)
|
|
|
|
iAdded =99;
|
|
|
|
|
|
|
|
object oTemp = OBJECT_INVALID;
|
|
|
|
object oSelf = OBJECT_SELF;
|
|
|
|
object oPC = GetLastDisturbed();
|
|
|
|
object oItem = GetInventoryDisturbItem();
|
|
|
|
string sItem = GetTag(oItem);
|
|
|
|
string sItemResRef = GetResRef(oItem);
|
|
|
|
int iHaveAllParts = 0;
|
|
|
|
int iCreated = 1;
|
|
|
|
int iInvalidItem = 0;
|
|
|
|
|
|
|
|
// 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 (GetLocalInt(OBJECT_SELF,"iAmInUse")!=0)
|
|
|
|
{
|
2024-09-16 23:40:48 -04:00
|
|
|
FloatingTextStringOnCreature("You must wait until the kiln is cooled off before starting any other craft.",oPC,FALSE);
|
2024-06-14 10:48:20 -04:00
|
|
|
if (iAdded != 99)CopyItem(oItem,oPC,TRUE);
|
|
|
|
DestroyObject(oItem);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sItem == "ITEM_SAND")iInvalidItem = 99;
|
|
|
|
if (GetStringLeft(sItemResRef,7) == "pattern") iInvalidItem = 99;
|
|
|
|
|
|
|
|
|
|
|
|
if (iInvalidItem==0)
|
|
|
|
{
|
|
|
|
FloatingTextStringOnCreature("You cannot fire this in a kiln to create anything useful.",oPC,FALSE);
|
|
|
|
CopyItem(oItem,oPC,TRUE);
|
|
|
|
DestroyObject(oItem);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (iAdded == 99)
|
|
|
|
{
|
|
|
|
CopyObject(oItem,GetLocation(OBJECT_SELF),OBJECT_SELF,GetTag(oItem));
|
|
|
|
if (GetItemPossessedBy(oPC,"TinkersToolset")==OBJECT_INVALID) iHaveAllParts = 99;
|
|
|
|
|
|
|
|
if (GetStringRight(sItemResRef,3)=="002")
|
|
|
|
{
|
|
|
|
if (GetItemPossessedBy(oPC,"ITEM_CLAY")==OBJECT_INVALID) iHaveAllParts = 99;
|
|
|
|
if (iHaveAllParts == 0)
|
|
|
|
{
|
|
|
|
oTemp = GetItemPossessedBy(oPC,"ITEM_CLAY");
|
|
|
|
DestroyObject(oTemp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetStringRight(sItemResRef,3)=="074") //Ring Mold
|
|
|
|
{
|
|
|
|
if (GetItemPossessedBy(oPC,"ITEM_CLAY")==OBJECT_INVALID) iHaveAllParts = 99;
|
|
|
|
if (iHaveAllParts == 0)
|
|
|
|
{
|
|
|
|
oTemp = GetItemPossessedBy(oPC,"ITEM_CLAY");
|
|
|
|
DestroyObject(oTemp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetStringRight(sItemResRef,3)=="098") //Necklace Mold
|
|
|
|
{
|
|
|
|
if (GetItemPossessedBy(oPC,"ITEM_CLAY")==OBJECT_INVALID) iHaveAllParts = 99;
|
|
|
|
if (iHaveAllParts == 0)
|
|
|
|
{
|
|
|
|
oTemp = GetItemPossessedBy(oPC,"ITEM_CLAY");
|
|
|
|
DestroyObject(oTemp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (GetStringRight(sItemResRef,3)=="099") //Amulet Mold
|
|
|
|
{
|
|
|
|
if (GetItemPossessedBy(oPC,"ITEM_CLAY")==OBJECT_INVALID) iHaveAllParts = 99;
|
|
|
|
if (iHaveAllParts == 0)
|
|
|
|
{
|
|
|
|
oTemp = GetItemPossessedBy(oPC,"ITEM_CLAY");
|
|
|
|
DestroyObject(oTemp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GetStringRight(sItemResRef,3)=="003")
|
|
|
|
{
|
|
|
|
if (GetNumItems(oPC,"ITEM_CLAY")<2) iHaveAllParts = 99;
|
|
|
|
if (iHaveAllParts == 0)
|
|
|
|
{
|
|
|
|
oTemp = GetItemPossessedBy(oPC,"ITEM_CLAY");
|
|
|
|
DestroyObject(oTemp);
|
|
|
|
DelayCommand(3.0,GetNextItemPossessedBy(oPC,"ITEM_CLAY"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetStringRight(sItemResRef,3)=="004")
|
|
|
|
{
|
|
|
|
if (GetNumItems(oPC,"ITEM_CLAY")<3) iHaveAllParts = 99;
|
|
|
|
if (iHaveAllParts == 0)
|
|
|
|
{
|
|
|
|
oTemp = GetItemPossessedBy(oPC,"ITEM_CLAY");
|
|
|
|
DestroyObject(oTemp);
|
|
|
|
DelayCommand(3.0,GetNextItemPossessedBy(oPC,"ITEM_CLAY"));
|
|
|
|
DelayCommand(6.0,GetNextItemPossessedBy(oPC,"ITEM_CLAY"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetStringRight(sItemResRef,3)=="010")
|
|
|
|
{
|
|
|
|
if (GetNumItems(oPC,"INGOT_GLASS")==0) iHaveAllParts = 99;
|
|
|
|
if (iHaveAllParts == 0)
|
|
|
|
{
|
|
|
|
oTemp = GetItemPossessedBy(oPC,"INGOT_GLASS");
|
|
|
|
DestroyObject(oTemp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetStringRight(sItemResRef,3)=="113")
|
|
|
|
{
|
|
|
|
if (GetNumItems(oPC,"INGOT_GLASS")==0) iHaveAllParts = 99;
|
|
|
|
if (iHaveAllParts == 0)
|
|
|
|
{
|
|
|
|
oTemp = GetItemPossessedBy(oPC,"INGOT_GLASS");
|
|
|
|
DestroyObject(oTemp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (GetStringRight(sItemResRef,3)=="011")
|
|
|
|
{
|
|
|
|
if (GetNumItems(oPC,"INGOT_GLASS")==0) iHaveAllParts = 99;
|
|
|
|
if (iHaveAllParts == 0)
|
|
|
|
{
|
|
|
|
oTemp = GetItemPossessedBy(oPC,"INGOT_GLASS");
|
|
|
|
DestroyObject(oTemp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetStringRight(sItemResRef,3)=="122") //cider jug
|
|
|
|
{
|
|
|
|
if (GetNumItems(oPC,"INGOT_GLASS")<2) iHaveAllParts = 99;
|
|
|
|
if (iHaveAllParts == 0)
|
|
|
|
{
|
|
|
|
oTemp = GetItemPossessedBy(oPC,"INGOT_GLASS");
|
|
|
|
DestroyObject(oTemp);
|
|
|
|
DelayCommand(3.0,GetNextItemPossessedBy(oPC,"INGOT_GLASS"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (iHaveAllParts == 99)
|
|
|
|
{
|
|
|
|
FloatingTextStringOnCreature("You do not have all the parts required to craft this item.",oPC,FALSE);
|
|
|
|
SendMessageToPC(oPC,"Examine the pattern before removing it to check what is required.");
|
|
|
|
DestroyObject(oItem);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
location lSelf = GetLocation(OBJECT_SELF);
|
|
|
|
float fSelf = GetFacing(OBJECT_SELF);
|
|
|
|
vector vSelf = GetPosition(OBJECT_SELF);
|
|
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
|
|
vector vFire;
|
|
|
|
int vDirection;
|
|
|
|
vFire = vSelf + (AngleToVector(fSelf) * 0.4);
|
|
|
|
location lFire = Location(oArea,vFire,fSelf);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//int iGlassSkill = GetTokenPair(oPC,14,4);
|
2024-09-16 23:40:48 -04:00
|
|
|
int iGlassSkill = GetCampaignInt("UOACraft","iGlassSkill",oPC);
|
2024-06-14 10:48:20 -04:00
|
|
|
int iGlassChance = iGlassSkill;
|
|
|
|
object oFire = CreatePlaceable("plc_flamemedium", lFire, 6.0);
|
|
|
|
|
|
|
|
string sCraft = "";
|
|
|
|
string sSuccessString = "";
|
|
|
|
string sFailString = "";
|
|
|
|
string sSoundSuccess = "";
|
|
|
|
string sSoundFail = "";
|
|
|
|
effect eSuccess;
|
|
|
|
effect eFail;
|
|
|
|
int iSuccessAnimation = 0;
|
|
|
|
int iFailAnimation = 0;
|
|
|
|
|
|
|
|
if (iGlassChance <350)
|
|
|
|
{
|
|
|
|
iGlassChance = GetAbilityScore(oPC,ABILITY_DEXTERITY)*4;
|
|
|
|
iGlassChance = iGlassChance+(GetAbilityScore(oPC,ABILITY_INTELLIGENCE)*3);
|
|
|
|
iGlassChance = iGlassChance+(GetAbilityScore(oPC,ABILITY_WISDOM)*3);
|
|
|
|
iGlassChance = iGlassChance *3;
|
|
|
|
if (iGlassChance > 350) iGlassChance = 350;
|
|
|
|
if (iGlassSkill > iGlassChance) iGlassChance = iGlassSkill;
|
|
|
|
}
|
|
|
|
|
|
|
|
AssignCommand(oPC,PlaySound("al_cv_firebowl1"));
|
|
|
|
AssignCommand(oPC,PlaySound("as_cv_mineshovl1"));
|
|
|
|
AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_MID,1.0,4.0));
|
|
|
|
PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE,1.0,6.0);
|
|
|
|
if (sItem == "ITEM_SAND")
|
|
|
|
{
|
|
|
|
if (iGlassChance < 250) iGlassChance = 0;
|
|
|
|
sCraft = "glassingot";
|
|
|
|
sSuccessString = "You melt the sand into a Glass Ingot";
|
2024-09-16 23:40:48 -04:00
|
|
|
sFailString = "The glass turns murky and the ingot shatters as it cools.";
|
2024-06-14 10:48:20 -04:00
|
|
|
sSoundFail = "as_cv_glasbreak2";
|
|
|
|
sSoundSuccess = "as_cv_barglass2";
|
|
|
|
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
|
|
|
|
eSuccess = EffectVisualEffect(VFX_COM_HIT_FROST,FALSE);
|
|
|
|
iSuccessAnimation = ANIMATION_LOOPING_TALK_PLEADING;
|
|
|
|
iFailAnimation = ANIMATION_LOOPING_PAUSE_TIRED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (iAdded ==99)
|
|
|
|
{
|
|
|
|
if (GetStringRight(sItemResRef,3)=="002")
|
|
|
|
{
|
|
|
|
iGlassChance = iGlassChance - 50;
|
|
|
|
sCraft = "smallcastmold";
|
|
|
|
sSuccessString = "You successfully glaze the small cast mold.";
|
2024-09-16 23:40:48 -04:00
|
|
|
sFailString = "The clay turns brittle and the mold shatters as it cools.";
|
2024-06-14 10:48:20 -04:00
|
|
|
sSoundFail = "as_cv_claybreak3";
|
|
|
|
sSoundSuccess = "as_cv_claybreak1";
|
|
|
|
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
|
|
|
|
eSuccess = EffectVisualEffect(VFX_COM_HIT_FROST,FALSE);
|
|
|
|
iSuccessAnimation = ANIMATION_LOOPING_TALK_PLEADING;
|
|
|
|
iFailAnimation = ANIMATION_LOOPING_PAUSE_TIRED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetStringRight(sItemResRef,3)=="074")
|
|
|
|
{
|
|
|
|
iGlassChance = iGlassChance - 50;
|
|
|
|
sCraft = "smallcastmold003";
|
|
|
|
sSuccessString = "You successfully glaze the ring mold.";
|
2024-09-16 23:40:48 -04:00
|
|
|
sFailString = "The clay turns brittle and the mold shatters as it cools.";
|
2024-06-14 10:48:20 -04:00
|
|
|
sSoundFail = "as_cv_claybreak3";
|
|
|
|
sSoundSuccess = "as_cv_claybreak1";
|
|
|
|
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
|
|
|
|
eSuccess = EffectVisualEffect(VFX_COM_HIT_FROST,FALSE);
|
|
|
|
iSuccessAnimation = ANIMATION_LOOPING_TALK_PLEADING;
|
|
|
|
iFailAnimation = ANIMATION_LOOPING_PAUSE_TIRED;
|
|
|
|
}
|
|
|
|
if (GetStringRight(sItemResRef,3)=="098") //necklace mold
|
|
|
|
{
|
|
|
|
iGlassChance = iGlassChance - 250;
|
|
|
|
sCraft = "smallcastmold004";
|
|
|
|
sSuccessString = "You successfully glaze the necklace mold.";
|
2024-09-16 23:40:48 -04:00
|
|
|
sFailString = "The clay turns brittle and the mold shatters as it cools.";
|
2024-06-14 10:48:20 -04:00
|
|
|
sSoundFail = "as_cv_claybreak3";
|
|
|
|
sSoundSuccess = "as_cv_claybreak1";
|
|
|
|
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
|
|
|
|
eSuccess = EffectVisualEffect(VFX_COM_HIT_FROST,FALSE);
|
|
|
|
iSuccessAnimation = ANIMATION_LOOPING_TALK_PLEADING;
|
|
|
|
iFailAnimation = ANIMATION_LOOPING_PAUSE_TIRED;
|
|
|
|
}
|
|
|
|
if (GetStringRight(sItemResRef,3)=="099") //amulet mold
|
|
|
|
{
|
|
|
|
iGlassChance = iGlassChance - 350;
|
|
|
|
sCraft = "smallcastmold005";
|
|
|
|
sSuccessString = "You successfully glaze the amulet mold.";
|
2024-09-16 23:40:48 -04:00
|
|
|
sFailString = "The clay turns brittle and the mold shatters as it cools.";
|
2024-06-14 10:48:20 -04:00
|
|
|
sSoundFail = "as_cv_claybreak3";
|
|
|
|
sSoundSuccess = "as_cv_claybreak1";
|
|
|
|
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
|
|
|
|
eSuccess = EffectVisualEffect(VFX_COM_HIT_FROST,FALSE);
|
|
|
|
iSuccessAnimation = ANIMATION_LOOPING_TALK_PLEADING;
|
|
|
|
iFailAnimation = ANIMATION_LOOPING_PAUSE_TIRED;
|
|
|
|
}
|
|
|
|
if (GetStringRight(sItemResRef,3)=="003")
|
|
|
|
{
|
|
|
|
iGlassChance = iGlassChance - 150;
|
|
|
|
sCraft = "smallcastmold001";
|
|
|
|
sSuccessString = "You successfully glaze the medium cast mold.";
|
2024-09-16 23:40:48 -04:00
|
|
|
sFailString = "The clay turns brittle and the mold shatters as it cools.";
|
2024-06-14 10:48:20 -04:00
|
|
|
sSoundFail = "as_cv_claybreak3";
|
|
|
|
sSoundSuccess = "as_cv_claybreak1";
|
|
|
|
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
|
|
|
|
eSuccess = EffectVisualEffect(VFX_COM_HIT_FROST,FALSE);
|
|
|
|
iSuccessAnimation = ANIMATION_LOOPING_TALK_PLEADING;
|
|
|
|
iFailAnimation = ANIMATION_LOOPING_PAUSE_TIRED;
|
|
|
|
}
|
|
|
|
if (GetStringRight(sItemResRef,3)=="004")
|
|
|
|
{
|
|
|
|
iGlassChance = iGlassChance - 250;
|
|
|
|
sCraft = "smallcastmold002";
|
|
|
|
sSuccessString = "You successfully glaze the large cast mold.";
|
2024-09-16 23:40:48 -04:00
|
|
|
sFailString = "The clay turns brittle and the mold shatters as it cools.";
|
2024-06-14 10:48:20 -04:00
|
|
|
sSoundFail = "as_cv_claybreak3";
|
|
|
|
sSoundSuccess = "as_cv_claybreak1";
|
|
|
|
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
|
|
|
|
eSuccess = EffectVisualEffect(VFX_COM_HIT_FROST,FALSE);
|
|
|
|
iSuccessAnimation = ANIMATION_LOOPING_TALK_PLEADING;
|
|
|
|
iFailAnimation = ANIMATION_LOOPING_PAUSE_TIRED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetStringRight(sItemResRef,3)=="010")
|
|
|
|
{
|
|
|
|
iGlassChance = iGlassChance - 75;
|
|
|
|
sCraft = "glassvial";
|
|
|
|
sSuccessString = "You successfully blow and shape the glass vial.";
|
2024-09-16 23:40:48 -04:00
|
|
|
sFailString = "The vial turns murky and shatters as it cools.";
|
2024-06-14 10:48:20 -04:00
|
|
|
sSoundFail = "as_cv_glasbreak2";
|
|
|
|
sSoundSuccess = "as_cv_barglass2";
|
|
|
|
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
|
|
|
|
eSuccess = EffectVisualEffect(VFX_COM_HIT_FROST,FALSE);
|
|
|
|
iSuccessAnimation = ANIMATION_LOOPING_TALK_PLEADING;
|
|
|
|
iFailAnimation = ANIMATION_LOOPING_PAUSE_TIRED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetStringRight(sItemResRef,3)=="011")
|
|
|
|
{
|
|
|
|
iGlassChance = iGlassChance - 250;
|
|
|
|
sCraft = "glassbottle";
|
|
|
|
sSuccessString = "You successfully blow and shape the glass bottle.";
|
2024-09-16 23:40:48 -04:00
|
|
|
sFailString = "The bottle turns murky and shatters as it cools.";
|
2024-06-14 10:48:20 -04:00
|
|
|
sSoundFail = "as_cv_glasbreak2";
|
|
|
|
sSoundSuccess = "as_cv_barglass2";
|
|
|
|
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
|
|
|
|
eSuccess = EffectVisualEffect(VFX_COM_HIT_FROST,FALSE);
|
|
|
|
iSuccessAnimation = ANIMATION_LOOPING_TALK_PLEADING;
|
|
|
|
iFailAnimation = ANIMATION_LOOPING_PAUSE_TIRED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetStringRight(sItemResRef,3)=="113")
|
|
|
|
{
|
|
|
|
iGlassChance = iGlassChance - 200;
|
|
|
|
iCreated=2;
|
|
|
|
sCraft = "yeastvial001";
|
|
|
|
sSuccessString = "You successfully blow and shape the yeast vials.";
|
2024-09-16 23:40:48 -04:00
|
|
|
sFailString = "The vials turn murky and shatter as they cool.";
|
2024-06-14 10:48:20 -04:00
|
|
|
sSoundFail = "as_cv_glasbreak2";
|
|
|
|
sSoundSuccess = "as_cv_barglass2";
|
|
|
|
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
|
|
|
|
eSuccess = EffectVisualEffect(VFX_COM_HIT_FROST,FALSE);
|
|
|
|
iSuccessAnimation = ANIMATION_LOOPING_TALK_PLEADING;
|
|
|
|
iFailAnimation = ANIMATION_LOOPING_PAUSE_TIRED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetStringRight(sItemResRef,3)=="122")
|
|
|
|
{
|
|
|
|
iGlassChance = iGlassChance - 400;
|
|
|
|
sCraft = "item_cask_006";
|
|
|
|
sSuccessString = "You successfully blow and shape the cider jug.";
|
2024-09-16 23:40:48 -04:00
|
|
|
sFailString = "The jug turns murky and shatters as it cools.";
|
2024-06-14 10:48:20 -04:00
|
|
|
sSoundFail = "as_cv_glasbreak2";
|
|
|
|
sSoundSuccess = "as_cv_barglass2";
|
|
|
|
eFail = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE,FALSE);
|
|
|
|
eSuccess = EffectVisualEffect(VFX_COM_HIT_FROST,FALSE);
|
|
|
|
iSuccessAnimation = ANIMATION_LOOPING_TALK_PLEADING;
|
|
|
|
iFailAnimation = ANIMATION_LOOPING_PAUSE_TIRED;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
SetLocalInt(OBJECT_SELF,"iAmInUse",99);
|
|
|
|
DelayCommand(7.0,SetLocalInt(OBJECT_SELF,"iAmInUse",0));
|
|
|
|
//ensure at least 1 respawn 10 minutes after used...
|
|
|
|
//this is to prevent a broken placeable that is used, with a 'in use' delay
|
|
|
|
//which would cancel the respawn
|
|
|
|
if (GetLocalInt(OBJECT_SELF,"iAmSetToRespawn")!=99)
|
|
|
|
{
|
|
|
|
SetLocalInt(OBJECT_SELF,"iAmSetToRespawn",99);
|
|
|
|
DelayCommand(600.0,ExecuteScript("_onclose_clear",OBJECT_SELF));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int iRandom = Random(1000);
|
|
|
|
int iSuccess = 0;
|
|
|
|
int iSkillGain = 0;
|
|
|
|
string sOldSkill = "";
|
|
|
|
string sOldSkill2 = "";
|
|
|
|
|
|
|
|
if (iRandom <= iGlassChance)
|
|
|
|
{
|
|
|
|
iSuccess = 1;
|
|
|
|
DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(iSuccessAnimation,1.0,1.0)));
|
|
|
|
DelayCommand(6.0,CreateAnObject(sCraft,oPC));
|
|
|
|
if (iCreated==2) DelayCommand(6.1,CreateAnObject(sCraft,oPC));
|
|
|
|
DelayCommand(6.0,FloatingTextStringOnCreature(sSuccessString,oPC,FALSE));
|
|
|
|
DelayCommand(5.8,PlaySound(sSoundSuccess));
|
|
|
|
DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eSuccess,oSelf,2.0));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(iFailAnimation,1.0,1.0)));
|
|
|
|
DelayCommand(6.0,FloatingTextStringOnCreature(sFailString,oPC,FALSE));
|
|
|
|
DelayCommand(6.0,PlaySound(sSoundFail));
|
|
|
|
DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eFail,oSelf,2.0));
|
|
|
|
}
|
|
|
|
DelayCommand(6.0,DestroyObject(oItem));
|
|
|
|
|
|
|
|
if (iSuccess == 1)
|
|
|
|
{
|
|
|
|
iRandom = Random(1000);
|
|
|
|
if (iRandom >= iGlassSkill)
|
|
|
|
{
|
|
|
|
if (d10(1)+1 >= iGlassChance/100) iSkillGain = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Ensure no more than 1 skill gain every 10 seconds to avoid token droppage.
|
|
|
|
if (iSkillGain ==1)
|
|
|
|
{
|
|
|
|
if (GetLocalInt(oPC,"iSkillGain")!= 0)
|
|
|
|
{
|
|
|
|
iSkillGain = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SetLocalInt(oPC,"iSkillGain",99);
|
|
|
|
DelayCommand(10.0,SetLocalInt(oPC,"iSkillGain",0));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (iSkillGain ==1)
|
|
|
|
{
|
|
|
|
string sOldSkill = "";
|
|
|
|
string sOldSkill2 = "";
|
|
|
|
iGlassSkill++;
|
|
|
|
sOldSkill2 = IntToString(iGlassSkill);
|
|
|
|
sOldSkill = "."+GetStringRight(sOldSkill2,1);
|
|
|
|
if (iGlassSkill > 9)
|
|
|
|
{
|
|
|
|
sOldSkill = GetStringLeft(sOldSkill2,GetStringLength(sOldSkill2)-1)+sOldSkill;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sOldSkill = "0"+sOldSkill;
|
|
|
|
}
|
|
|
|
if (iGlassSkill <= 1000)
|
|
|
|
{
|
|
|
|
//DelayCommand(5.0,SetTokenPair(oPC,14,4,iGlassSkill));
|
2024-09-16 23:40:48 -04:00
|
|
|
DelayCommand(6.0,SetCampaignInt("UOACraft","iGlassSkill",iGlassSkill,oPC));
|
2024-06-14 10:48:20 -04:00
|
|
|
DelayCommand(6.0,SendMessageToPC(oPC,"============================"));
|
|
|
|
DelayCommand(6.0,SendMessageToPC(oPC,"Your Kiln skill has gone up!"));
|
|
|
|
DelayCommand(6.0,SendMessageToPC(oPC,"Current Kiln skill : "+ sOldSkill+"%"));
|
|
|
|
DelayCommand(6.0,SendMessageToPC(oPC,"============================"));
|
|
|
|
if (GetLocalInt(GetModule(),"_UOACraft_XP")!=0) DelayCommand(5.9,GiveXPToCreature(oPC,GetLocalInt(GetModule(),"_UOACraft_XP")));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CreateAnObject(string sResource, object oPC)
|
|
|
|
{
|
|
|
|
CreateItemOnObject(sResource,oPC,1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
object CreatePlaceable(string sObject, location lPlace, float fDuration)
|
|
|
|
{
|
|
|
|
object oPlaceable = CreateObject(OBJECT_TYPE_PLACEABLE,sObject,lPlace,FALSE);
|
|
|
|
if (fDuration != 0.0)
|
|
|
|
DestroyObject(oPlaceable,fDuration);
|
|
|
|
return oPlaceable;
|
|
|
|
}
|
|
|
|
|
|
|
|
void GetNextItemPossessedBy(object oPC, string sItemTag)
|
|
|
|
{
|
|
|
|
object oTemp = GetItemPossessedBy(oPC,sItemTag);
|
|
|
|
DestroyObject(oTemp);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|