Magical Ammo

Post your tips, ideas for improvements, requests for new features, etc. here
Locked
jjdl
Noob
Posts: 5
Joined: Mon Jan 05, 2009 7:25 am

Magical Ammo

Post by jjdl »

Why not to add a item to release the archer's bag .
I know some mods have a item to restack the ammo.
i.e. if i have 34 arrow in a stack . i use the item on the arrows , it will become 99 arrows and i will lose some GP equal to 65 arrow.

the code may like this in the mod event(i wrote them by myself and don't know if any bug in it):

if (GetTag(GetItemActivated()) == "MagicAmmo")
{
if ((GetBaseItemType(oTarget) == BASE_ITEM_ARROW)
|| (GetBaseItemType(oTarget) == BASE_ITEM_BOLT)
|| (GetBaseItemType(oTarget) == BASE_ITEM_DART)
|| (GetBaseItemType(oTarget) == BASE_ITEM_THROWINGAXE)
|| (GetBaseItemType(oTarget) == BASE_ITEM_SHURIKEN)
|| (GetBaseItemType(oTarget) == BASE_ITEM_BULLET)){
int nCrtSize = GetItemStackSize(oTarget);
int nMaxAmmo;
if ((GetBaseItemType(oTarget) == BASE_ITEM_ARROW)
|| (GetBaseItemType(oTarget) == BASE_ITEM_BOLT)
|| (GetBaseItemType(oTarget) == BASE_ITEM_BULLET)){
nMaxAmmo = 99;
}
else{
nMaxAmmo = 50;
}

int nValue = GetGoldPieceValue(oTarget) * (nMaxAmmo - nCrtSize) ; //the value,change to what u dms wanna
int nGP = GetGold(oPC);
if (nGP >= nValue){
SetItemStackSize(oTarget,nMaxAmmo);
SetStolenFlag(oTarget,TRUE); // make sure no one use this to make gp
AssignCommand(oPC , TakeGoldFromCreature(nValue,oPC,TRUE));
}
else{
FloatingTextStringOnCreature("You have not enough money to do this...",oPC);
}
}
else{
FloatingTextStringOnCreature("You can not use it on this...",oPC);
}
}

Locked

Return to “NS4 Ideas and Suggestions”