Script Name: Training Placeable
What it does: Add this script to the OnDamage of any placeable and it turns it
into a training utility. By giving the last damager XP and taking money. It
gives a random amount of XP between 0 and 30 and takes 50gp every time you get a
hit on it. It's not really worth the exp given but its just a way to kill time
in a mod.
Script:
void main()
{
int xpTarget = Random(30);
GiveXPToCreature(GetLastDamager(), xpTarget);
TakeGoldFromCreature(50, GetLastDamager(), TRUE);
FloatingTextStringOnCreature("You got XP!", GetLastDamager(), FALSE);
}
Thats it... simple as that.
This script and tons more can be found at
http://www.onitt.com
Sign up for my forums.. I will be adding a ton more scripts there over the next
few days.
* * * * *
The problem with this script is that it allows anyone to beat on it
indefinitely. You need to build another statement in there to ensure that
everyone has the money before giving xp. I've modified this already but I don't
have the code in front of me.
Just do this:
set another var:
int nPCGold = GetGold(GetLastDamager());
and do and if else... if the GetGold<50 (in your case) then do a
FloatingTextStringOnCreature("You need 50GP to practice", GetLastDamager(),
FALSE);
Basically...like that (doing this by memory folks)..
Enjoy!
-=Anthony=-
www.NWNOnline.net
24x7 persistent world of 500+players screaming at ICBs