33 lines
1.0 KiB
Plaintext
33 lines
1.0 KiB
Plaintext
//lumber_axe - Lumber Jack Axe special ability
|
|
void main()
|
|
{
|
|
object oPC=GetItemActivator();
|
|
object oAxe=GetItemActivated();
|
|
string sRes="";
|
|
int nLHour=GetLocalInt(oAxe,"nLHour");
|
|
int nHour=GetTimeHour();
|
|
object oWood;
|
|
if (nHour!=nLHour)
|
|
{ // useable
|
|
oWood=GetNearestObjectByTag("WOOD_ELMWOOD",oPC);
|
|
if (oWood!=OBJECT_INVALID) sRes="x2_it_cmat_elmw";
|
|
oWood=GetNearestObjectByTag("WOOD_IRONWOOD",oPC);
|
|
if (oWood!=OBJECT_INVALID) sRes="x2_it_cmat_ironw";
|
|
oWood=GetNearestObjectByTag("WOOD_OAKENWOOD",oPC);
|
|
if (oWood!=OBJECT_INVALID) sRes="x2_it_cmat_oakw";
|
|
if (GetStringLength(sRes)>2)
|
|
{ // wood here
|
|
SetLocalInt(oAxe,"nLHour",nHour);
|
|
CreateItemOnObject(sRes,oPC,1);
|
|
} // wood here
|
|
else
|
|
{ // no wood source
|
|
SendMessageToPC(oPC,"There is no viable wood source to harvest in this area.");
|
|
} // no wood source
|
|
} // useable
|
|
else
|
|
{ // message
|
|
SendMessageToPC(oPC,"You may only harvest wood once per hour with this item.");
|
|
} // message
|
|
}
|