179 lines
6.8 KiB
Plaintext
179 lines
6.8 KiB
Plaintext
|
void CreateAnObject(string sResource, object oPC, int iQty);
|
||
|
void CreatePlaceable(string sObject, location lPlace, float fDuration);
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
//SendMessageToPC(GetFirstPC(),"Fillet Fish Script Running");
|
||
|
object oSelf = OBJECT_SELF;
|
||
|
object oPC;
|
||
|
|
||
|
if (GetIsObjectValid(oSelf)==FALSE) return; //we do not want to crash the server by having anvalid objects running scripts lol
|
||
|
string sTagSelf = GetTag(oSelf);
|
||
|
|
||
|
oPC = GetLocalObject(oSelf,"oPC");
|
||
|
if (GetIsObjectValid(oPC)==FALSE) return;
|
||
|
|
||
|
if (GetStringLeft(sTagSelf,5)!="FISH_")
|
||
|
{
|
||
|
FloatingTextStringOnCreature("You can only fillet a fish!",oPC,FALSE);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
|
||
|
if (GetLocalInt(OBJECT_SELF,"sIAmUsed") != 0) return;
|
||
|
SetLocalInt(OBJECT_SELF,"sIAmUsed",99);
|
||
|
|
||
|
|
||
|
int iWeight = 0;
|
||
|
int iDifficulty=0;
|
||
|
|
||
|
|
||
|
|
||
|
//Easy Fish to fillet
|
||
|
if (sTagSelf=="FISH_BLUEGILL") iWeight=5;
|
||
|
if (sTagSelf=="FISH_CRAPPIE") iWeight=5;
|
||
|
if (sTagSelf=="FISH_SHAD") iWeight=5;
|
||
|
if (sTagSelf=="FISH_SMALLMOUTHBASS") iWeight=5;
|
||
|
if (sTagSelf=="FISH_LARGEMOUTHBASS") iWeight=5;
|
||
|
if (sTagSelf=="FISH_CARP") iWeight=5;
|
||
|
if (sTagSelf=="FISH_FLOUNDER") iWeight=5;
|
||
|
if (sTagSelf=="FISH_SEABASS") iWeight=5;
|
||
|
if (sTagSelf=="FISH_CHANNELCATFISH01") iWeight=5;
|
||
|
|
||
|
//Semi-easy to fillet
|
||
|
if (sTagSelf=="FISH_BLACKSEABASS"){iWeight=10;iDifficulty=100;}
|
||
|
if (sTagSelf=="FISH_CHANNELCATFISH02") {iWeight=10;iDifficulty=100;}
|
||
|
if (sTagSelf=="FISH_FLUKE") {iWeight=10;iDifficulty=100;}
|
||
|
if (sTagSelf=="FISH_MACKEREL") {iWeight=10;iDifficulty=100;}
|
||
|
if (sTagSelf=="FISH_RAINBOWTROUT") {iWeight=10;iDifficulty=100;}
|
||
|
if (sTagSelf=="FISH_CHANNELCATFISH03") {iWeight=15;iDifficulty=150;}
|
||
|
|
||
|
//Medium difficulty
|
||
|
if (sTagSelf=="FISH_BLUEFISH") {iWeight=20;iDifficulty=200;}
|
||
|
if (sTagSelf=="FISH_COD") {iWeight=20;iDifficulty=200;}
|
||
|
if (sTagSelf=="FISH_CHANNELCATFISH04") {iWeight=20;iDifficulty=200;}
|
||
|
if (sTagSelf=="FISH_CHANNELCATFISH05") {iWeight=25;iDifficulty=250;}
|
||
|
if (sTagSelf=="FISH_CHANNELCATFISH06") {iWeight=35;iDifficulty=300;}
|
||
|
|
||
|
//Hard to fillet
|
||
|
if (sTagSelf=="FISH_STRIPEDBASS") {iWeight=50;iDifficulty=350;}
|
||
|
if (sTagSelf=="FISH_BLUESHARK") {iWeight=80;iDifficulty=350;}
|
||
|
if (sTagSelf=="FISH_WHITEMARLIN") {iWeight=80;iDifficulty=350;}
|
||
|
if (sTagSelf=="FISH_YELLOWFINTUNA") {iWeight=125;iDifficulty=400;}
|
||
|
|
||
|
//Very Hard to fillet
|
||
|
if (sTagSelf=="FISH_MAKOSHARK") {iWeight=150;iDifficulty=450;}
|
||
|
if (sTagSelf=="FISH_SWORDFISH") {iWeight=200;iDifficulty=475;}
|
||
|
if (sTagSelf=="FISH_BLUEFINTUNA") {iWeight=300;iDifficulty=500;}
|
||
|
|
||
|
int iSkinSkill = GetCampaignInt("UOACraft","iSkinningSkill",oPC);
|
||
|
int iSkinChance = iSkinSkill;
|
||
|
if (iSkinChance < 350)
|
||
|
{
|
||
|
iSkinChance = GetAbilityScore(oPC,ABILITY_DEXTERITY)*5;
|
||
|
iSkinChance = iSkinChance+(GetAbilityScore(oPC,ABILITY_STRENGTH)*3);
|
||
|
iSkinChance = iSkinChance+(GetAbilityScore(oPC,ABILITY_INTELLIGENCE)*2);
|
||
|
iSkinChance = iSkinChance*3;
|
||
|
if (iSkinChance >350) iSkinChance = 350;
|
||
|
if (iSkinSkill > iSkinChance) iSkinChance = iSkinSkill;
|
||
|
}
|
||
|
iSkinChance = iSkinChance - iDifficulty;
|
||
|
if (iSkinChance <1)
|
||
|
{
|
||
|
FloatingTextStringOnCreature("You have no idea how to properly fillet this fish.",oPC,FALSE);
|
||
|
SetLocalInt(OBJECT_SELF,"sIAmUsed",0);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
int iRandom = Random(1000);
|
||
|
if (iRandom > iSkinChance)
|
||
|
{
|
||
|
//SendMessageToPC(oPC,"SkinChance: "+IntToString(iSkinChance));
|
||
|
AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0,6.0));
|
||
|
AssignCommand(oPC,DelayCommand(5.0,FloatingTextStringOnCreature("You mangle the fish while trying to fillet it.",oPC,FALSE)));
|
||
|
//AssignCommand(oPC,DelayCommand(2.5,CreatePlaceable("plc_pileskulls",lSelf,30.0)));
|
||
|
//AssignCommand(oPC,DelayCommand(2.0,CreatePlaceable("plc_bloodstain",lSelf,60.0)));
|
||
|
//AssignCommand(oCorpse,DelayCommand(2.0,ExecuteScript("_kill_corpse",oCorpse)));
|
||
|
DestroyObject(OBJECT_SELF);
|
||
|
return;
|
||
|
}
|
||
|
iRandom = Random(1000);
|
||
|
int iSkillGain = 0;
|
||
|
if (iRandom > (iSkinSkill - iDifficulty))iSkillGain = 1;
|
||
|
|
||
|
int iFilletQty = iWeight/5;
|
||
|
|
||
|
string sPCMessage1 = "You carefully fillet the fish.";
|
||
|
string sPCMessage2 = "You get a total of "+IntToString(iFilletQty)+" fillet";
|
||
|
if (iFilletQty >1) sPCMessage2 = sPCMessage2+"s";
|
||
|
sPCMessage2 = sPCMessage2+".";
|
||
|
|
||
|
location lSelf=GetLocation(oPC);
|
||
|
AssignCommand(oPC,DelayCommand(2.0,CreatePlaceable("plc_bloodstain",lSelf,300.0)));
|
||
|
AssignCommand(oPC,DelayCommand(5.0,FloatingTextStringOnCreature(sPCMessage1,oPC,FALSE)));
|
||
|
AssignCommand(oPC,DelayCommand(6.0,FloatingTextStringOnCreature(sPCMessage2,oPC,FALSE)));
|
||
|
AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0,6.0));
|
||
|
AssignCommand(oPC,DelayCommand(6.1,CreateAnObject("rawfishfillet",oPC,iFilletQty)));
|
||
|
AssignCommand(oPC,DelayCommand(1.0,PlaySound("as_an_crittgnaw1")));
|
||
|
AssignCommand(oPC,DelayCommand(3.0,PlaySound("as_an_crittgnaw2")));
|
||
|
AssignCommand(oPC,DelayCommand(4.9,PlaySound("as_an_crittgnaw3")));
|
||
|
DelayCommand(1.9, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPARKS_PARRY), lSelf));
|
||
|
DelayCommand(2.8, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPARKS_PARRY), lSelf));
|
||
|
DelayCommand(4.0, ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_SPARKS_PARRY), lSelf));
|
||
|
|
||
|
//Ensure no more than 1 skill gain every 10 seconds.
|
||
|
if (iSkillGain ==1)
|
||
|
{
|
||
|
if (GetLocalInt(oPC,"iSkillGain")!= 0)
|
||
|
{
|
||
|
iSkillGain = 0;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
SetLocalInt(oPC,"iSkillGain",99);
|
||
|
AssignCommand(oPC,DelayCommand(10.0,SetLocalInt(oPC,"iSkillGain",0)));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (iSkillGain ==1)
|
||
|
{
|
||
|
string sOldSkill = "";
|
||
|
string sOldSkill2 = "";
|
||
|
iSkinSkill++;
|
||
|
sOldSkill2 = IntToString(iSkinSkill);
|
||
|
sOldSkill = "."+GetStringRight(sOldSkill2,1);
|
||
|
if (iSkinSkill > 9)
|
||
|
{
|
||
|
sOldSkill = GetStringLeft(sOldSkill2,GetStringLength(sOldSkill2)-1)+sOldSkill;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
sOldSkill = "0"+sOldSkill;
|
||
|
}
|
||
|
if (iSkinSkill <= 1000)
|
||
|
{
|
||
|
//DelayCommand(5.0,SetTokenPair(oPC,14,8,iSkinSkill));
|
||
|
DelayCommand(5.0,SetCampaignInt("UOACraft","iSkinningSkill",iSkinSkill,oPC));
|
||
|
AssignCommand(oPC,DelayCommand(7.0,SendMessageToPC(oPC,"================================")));
|
||
|
AssignCommand(oPC,DelayCommand(7.0,SendMessageToPC(oPC,"Your Skinning skill has gone up!")));
|
||
|
AssignCommand(oPC,DelayCommand(7.0,SendMessageToPC(oPC,"Current Skinning skill : "+ sOldSkill+"%")));
|
||
|
AssignCommand(oPC,DelayCommand(7.0,SendMessageToPC(oPC,"================================")));
|
||
|
}
|
||
|
}
|
||
|
DestroyObject(OBJECT_SELF,6.0);
|
||
|
|
||
|
}
|
||
|
|
||
|
void CreateAnObject(string sResource, object oPC, int iQty)
|
||
|
{
|
||
|
CreateItemOnObject(sResource,oPC,iQty);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
void CreatePlaceable(string sObject, location lPlace, float fDuration)
|
||
|
{
|
||
|
object oPlaceable = CreateObject(OBJECT_TYPE_PLACEABLE,sObject,lPlace,FALSE);
|
||
|
if (fDuration != 0.0)
|
||
|
DestroyObject(oPlaceable,fDuration);
|
||
|
}
|