Ok, since my script hotkey hackery is sometimes positional, it makes not much sense to activate all the non-modal actions of all characters.
For instance, pressing the "disarm trap" hotkey and having all characters checking to see if a trap is near enough them is wasteful. Only allow a single (!) selected char to access this ability (single, not neareast, because we can't know who is nearest... not without more slowdown at least) would be better.
This would probably be worthwhile so that people don't click the hotkey with all chars selected and slllooooooooowww down the the game for a while, and only slooooow it.
Looking for guidance here, is there any way to check for the selected state of a AI in bgscript? Ie: that the others are NOT selected?
Then there is the case of party wide buffs - in this case, we need to check:
1) If party is not already affected by the buff
2) If anyone doesn't have the buff
3) Prevent others from casting it unnecessarily.
Something like this:
IF !SpellCast(Player1, STATE_BLESS) !SpellCast(Player2, STATE_BLESS) !SpellCast(Player3, STATE_BLESS) !SpellCast(Player4, STATE_BLESS) !SpellCast(Player5, STATE_BLESS) !SpellCast(Player6, STATE_BLESS) OR(6) NotStateCheck(Player1, STATE_BLESS) NotStateCheck(Player2, STATE_BLESS) NotStateCheck(Player3, STATE_BLESS) NotStateCheck(Player4, STATE_BLESS) NotStateCheck(Player5, STATE_BLESS) NotStateCheck(Player6, STATE_BLESS) OR(2) TriggerOverride(Player1, HaveSpell(CLERIC_BLESS)) See(Player1) OR(2) TriggerOverride(Player2, HaveSpell(CLERIC_BLESS)) See(Player2) OR(2) TriggerOverride(Player3, HaveSpell(CLERIC_BLESS)) See(Player3) OR(2) TriggerOverride(Player4, HaveSpell(CLERIC_BLESS)) See(Player4) OR(2) TriggerOverride(Player5, HaveSpell(CLERIC_BLESS)) See(Player5) OR(2) TriggerOverride(Player6, HaveSpell(CLERIC_BLESS)) See(Player6) //I AM THE CHOSEN ONE! Range(LastSeenBy,0) THEN Spell(LastSeenBy,CLERIC_BLESS) Continue() END
It would still have problems if they were separated...
and if one that had it were invisible... pity that LastTrigger will not work for HaveSpell...
and i don't know if the
!SpellCast(Player, STATE_BLESS)
checks are needed.
And i'm not Sure if See(Myself) (or Player1 in this case for ex) will work, in which case, this idea is pointless.
Edited by i30817, 27 November 2011 - 03:18 AM.