| Author |
Sticky:
Post Working Scripts Here |
|
Luminous
|
Posted: Friday, 26 July 06:26AM
|
1. Orcish Wrestling 2. Another script for my House of Games, this is for a large Half-Orc (but can be used for anyone). The idea is the player pays 5 gold pieces to wrestle - more like Indian Wrestling. If the player is able to knock the wrestler down, the player gets 10 gold. If the player is knocked down, the player gets nothing except laughed at.
I don't think the animations are working quite right, it may have something to do with the timing. They are flavor anyway and not necessary for the core function.
3. The script is a straight out Opposed Strength check, but can be modified with certain other variables. It could be used to give a new skill (wrestling) to the character which could then be used as a modifier in future matches. I'm going to put in a LocalInt which counts a person's victories, over 3 and the wrestler won't wrestle. This also requires the NPC to have the tag 'wrestler' or change that part of the script to whatever tag you want.
NWScript:
void main()
{
object oPC = GetPCSpeaker();
object oNPC = GetObjectByTag("wrestler");
int nGold = GetGold(oPC);
int nPCSTR = GetAbilityScore(oPC, ABILITY_STRENGTH);
int nPCSTR_MOD = (nPCSTR/2)-5;
int nNPCSTR = GetAbilityScore(oNPC, ABILITY_STRENGTH);
int nNPCSTR_MOD = (nNPCSTR/2)-5;
int nNPCDC = d20(1) + nNPCSTR_MOD;
int nPCSKILLCHECK = d20(1) + nPCSTR_MOD;
ClearAllActions();
if (nGold - 5 >= 0)
{
TakeGoldFromCreature(5, oPC, FALSE);
AssignCommand(oNPC, ActionPlayAnimation(ANIMATION_FIREFORGET_TAUNT));
if (nPCSKILLCHECK > nNPCDC)
{
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY1));
ActionSpeakString("Arrgh, my ass! You've bested me at my own game!", TALKVOLUME_TALK);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oNPC, 1.0f);
GiveGoldToCreature(oPC, 10);
DelayCommand(3.0, RemoveEffect(oNPC, EffectKnockdown()));
}
else
{
AssignCommand(oNPC, ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY1));
ActionSpeakString("I win again! Good effort though, try again when you gain some strength", TALKVOLUME_TALK);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oPC, 1.0f);
DelayCommand(3.0, RemoveEffect(oPC, EffectKnockdown()));
}
}
else
{
ActionSpeakString("You don't have enough gold to wrestle me, come back when you get some!", TALKVOLUME_TALK);
}
}
sdf2008@stygianlabyrinth.net http://nwn.nideanet.com/ |
|