//Put this on action taken in the conversation editor
#include "nw_i0_tool"
void main()
{
object oPC = GetPCSpeaker();
int nPercent = d100();
int nFishCaught = GetLocalInt(oPC, "GetTotalFishCaught");
int nFishLimit = 10; //Change this number to the limit of fish they can catch
if (nFishCaught > nFishLimit) {
SendMessageToPC(oPC, "You have caught your limit of fish.");
return;
}
if (nPercent <= 50)//50% chance to catch a crayfish
{
RewardPartyXP(50, oPC, FALSE);
CreateItemOnObject("cray_fish", oPC);
SendMessageToPC(oPC, "You caught a crayfish!");
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY2));
if (nPercent <= 3)//3% of the time the crayfish you caught bites you
{
SendMessageToPC(oPC, "A crayfish bites you!");
effect eEffect = EffectDamage(1, DAMAGE_TYPE_PIERCING, DAMAGE_POWER_NORMAL);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_STEAL));
}
}
else if (nPercent >= 51 &&
nPercent <= 90)//40% chance to catch a trout
{
RewardPartyXP(40, oPC, FALSE);
CreateItemOnObject("trout", oPC);
SendMessageToPC(oPC, "You caught a trout!");
}
else if (nPercent >= 91 &&
nPercent <= 97)//7% chance to catch a salmon
{
RewardPartyXP(100, oPC, FALSE);
CreateItemOnObject("salmon_fish", oPC);
SendMessageToPC(oPC, "You caught a salmon!");
}
else if (nPercent >= 98)//3% chance to catch a blow-fish
{
RewardPartyXP(200, oPC, FALSE);
CreateItemOnObject("salmon_fish001", oPC);
SendMessageToPC(oPC, "You caught a blow-fish!");
}
SetLocalInt(oPC, "GetTotalFishCaught", nFishCaught++);
}
Modifié par Thayan, 01 mars 2011 - 10:11 .