Jump to content


About Arrows And Ammunition


  • Please log in to reply
2 replies to this topic

#1 -DSlaytern-

-DSlaytern-
  • Guest

Posted 18 November 2002 - 02:40 AM

Is it possible to change the ammunition type that a character is using? For example, character QAZ has Unenchanted Arrows and Flame Arrows in his Quiver Quickslots.

How do I tell QAZ to switch between the two?

#2 -DSlaytern-

-DSlaytern-
  • Guest

Posted 18 November 2002 - 06:10 AM

Oh, and I am having a problem. My Archer keeps on jerking, as in she keeps on pausing everytime I want her to walk a certain distance. To put it bluntly, where did I go wrong?

// ~SETTING GLOBAL VARIABLES~

IF
PartyRested()
THEN
RESPONSE #100
SetGlobal("GlovesOfHealing","LOCALS",0)
END
IF
Global("Trigger","LOCALS",0)
THEN
RESPONSE #100
SetGlobal("Trigger","LOCALS",1)
SetGlobalTimer("PotionDrank","LOCALS",0)
END

// ~POTIONS~

// Elixir of Health
IF
StateCheck(Myself,STATE_POISONED)
!GlobalTimerNotExpired("PotionDrank","LOCALS")
!HPPercentGT(Myself,80)
HasItem("POTN17",Myself)
THEN
RESPONSE #100
ActionOverride(Myself,UseItem("POTN17",Myself))
SetGlobalTimer("PotionDrank","LOCALS",12)
AttackReevaluate(NearestEnemyOf(Myself),15)
END

// Antidote
IF
StateCheck(Myself,STATE_POISONED)
!GlobalTimerNotExpired("PotionDrank","LOCALS")
HasItem("POTN20",Myself)
THEN
RESPONSE #100
ActionOverride(Myself,UseItem("POTN20",Myself))
SetGlobalTimer("PotionDrank","LOCALS",12)
AttackReevaluate(NearestEnemyOf(Myself),15)
END

// Potion of Regeneration
IF
!GlobalTimerNotExpired("PotionDrank","LOCALS")
!GlobalTimerNotExpired("PotionOfRegeneration","LOCALS")
!HPPercentGT(Myself,75)
HasItem("POTN42",Myself)
THEN
RESPONSE #100
UseItem("POTN42",Myself)
SetGlobalTimer("PotionDrank","LOCALS",6)
SetGlobalTimer("PotionOfRegeneration","LOCALS",180)
AttackReevaluate(NearestEnemyOf(Myself),15)
END

// Tree of Life Nut
IF
!GlobalTimerNotExpired("PotionDrank","LOCALS")
!HPPercentGT(Myself,50)
HasItem("MISCBQ",Myself)
THEN
RESPONSE #100
ActionOverride(Myself,UseItem("MISCBQ",Myself))
SetGlobalTimer("PotionDrank","LOCALS",12)
AttackReevaluate(NearestEnemyOf(Myself),15)
END

// Potion of Superior Healing
IF
!GlobalTimerNotExpired("PotionDrank","LOCALS")
!HPPercentGT(Myself,50)
HasItem("POTN55",Myself)
THEN
RESPONSE #100
ActionOverride(Myself,UseItem("POTN55",Myself))
SetGlobalTimer("PotionDrank","LOCALS",12)
AttackReevaluate(NearestEnemyOf(Myself),15)
END

// Potion of Extra Healing
IF
!GlobalTimerNotExpired("PotionDrank","LOCALS")
!HPPercentGT(Myself,70)
HasItem("POTN52",Myself)
THEN
RESPONSE #100
ActionOverride(Myself,UseItem("POTN52",Myself))
SetGlobalTimer("PotionDrank","LOCALS",12)
AttackReevaluate(NearestEnemyOf(Myself),15)
END

// Potion of Healing
IF
!GlobalTimerNotExpired("PotionDrank","LOCALS")
!HPPercentGT(Myself,90)
HasItem("POTN08",Myself)
THEN
RESPONSE #100
ActionOverride(Myself,UseItem("POTN08",Myself))
SetGlobalTimer("PotionDrank","LOCALS",12)
AttackReevaluate(NearestEnemyOf(Myself),15)
END

// Potion of Heroism
IF
See([ENEMY])
!CheckStatLT(NearestEnemyOf(Myself),4000,XPVALUE)
!GlobalTimerNotExpired("PotionDrank","LOCALS")
!GlobalTimerNotExpired("PotionOfHeroism","LOCALS")
HasItem("POTN09",Myself)
THEN
RESPONSE #100
UseItem("POTN09",Myself)
SetGlobalTimer("PotionDrank","LOCALS",6)
SetGlobalTimer("PotionOfHeroism","LOCALS",600)
AttackReevaluate(NearestEnemyOf(Myself),15)
END

// Potion of Invulnerability
IF
See([ENEMY])
!CheckStatLT(NearestEnemyOf(Myself),8000,XPVALUE)
!GlobalTimerNotExpired("PotionDrank","LOCALS")
!GlobalTimerNotExpired("PotionOfInvulnerability","LOCALS")
HasItem("POTN11",Myself)
THEN
RESPONSE #100
UseItem("POTN11",Myself)
SetGlobalTimer("PotionDrank","LOCALS",6)
SetGlobalTimer("PotionOfInvulnerability","LOCALS",300)
AttackReevaluate(NearestEnemyOf(Myself),15)
END

// Oil of Speed
IF
See([ENEMY])
!CheckStatLT(NearestEnemyOf(Myself),4000,XPVALUE)
!GlobalTimerNotExpired("OilOfSpeed","LOCALS")
!GlobalTimerNotExpired("PotionDrank","LOCALS")
!StateCheck(Myself,STATE_HASTED)
HasItem("POTN14",Myself)
THEN
RESPONSE #100
UseItem("POTN14",Myself)
SetGlobalTimer("PotionDrank","LOCALS",6)
SetGlobalTimer("OilOfSpeed","LOCALS",300)
AttackReevaluate(NearestEnemyOf(Myself),15)
END

// Potion of Power
IF
See([ENEMY])
!CheckStatLT(NearestEnemyOf(Myself),8000,XPVALUE)
!GlobalTimerNotExpired("PotionDrank","LOCALS")
!GlobalTimerNotExpired("PotionOfPower","LOCALS")
HasItem("POTN41",Myself)
THEN
RESPONSE #100
UseItem("POTN41",Myself)
SetGlobalTimer("PotionDrank","LOCALS",6)
SetGlobalTimer("PotionOfPower","LOCALS",240)
AttackReevaluate(NearestEnemyOf(Myself),15)
END

// Goodberry
IF
!See([ENEMY])
HPPercentLT(Myself,100)
HasItem("GBerry",Myself)
THEN
RESPONSE #100
UseItem("GBerry",Myself)
END

// ~HEALING SPELLS~

// Cure Critical Wounds
IF
!See([ENEMY])
!HPPercentGT(MostDamagedOf(Myself),75)
!StateCheck(MostDamagedOf(Myself),STATE_INVISIBLE)
HasItemEquiped("SCRL56",Myself)
THEN
RESPONSE #100
UseItem("SCRL56",MostDamagedOf(Myself))
END

// Gloves of Healing
IF
!See([ENEMY])
Global("GlovesOfHealing","LOCALS",0)
!HPPercentGT(Myself,80)
!StateCheck(Myself,STATE_INVISIBLE)
HasItemEquiped("BRAC20",Myself)
THEN
RESPONSE #100
UseItem("BRAC20",Myself)
SetGlobal("GlovesOfHealing","LOCALS",1)
END

// Cure Light Wounds
IF
!See([ENEMY])
!HPPercentGT(MostDamagedOf(Myself),75)
!StateCheck(MostDamagedOf(Myself),STATE_INVISIBLE)
HaveSpell(1103)
THEN
RESPONSE #100
Spell(MostDamagedOf(Myself),1103)
END

// ~DAILY SPELLS~

// Goodberry
IF
HaveSpell(1207)
THEN
RESPONSE #100
Spell(Myself,1207)
END

// ~DEFENSIVE SPELLS~

// Armour of Faith
IF
See([ENEMY])
!GlobalTimerNotExpired("ArmorOfFaith","LOCALS")
HaveSpell(1111)
THEN
RESPONSE #100
Spell(Myself,1111)
SetGlobalTimer("ArmorOfFaith","LOCALS",138)
END

// Resist Fire/Cold
IF
See([ENEMY])
OR(2)
CheckStatLT(Myself,50,RESISTCOLD)
CheckStatLT(Myself,50,RESISTFIRE)
HaveSpell(1210)
THEN
RESPONSE #100
Spell(Myself,1210)
END

// ~PHYSICAL COMBAT~

// Called Shot
IF
See([ENEMY])
CheckStatLT(NearestEnemyOf(Myself),100,RESISTPIERCING)
!CheckStatLT(NearestEnemyOf(Myself),1400,XPVALUE)
!GlobalTimerNotExpired("CalledShot","LOCALS")
HaveSpell(4121)
THEN
RESPONSE #100
Spell(Myself,4121)
SetGlobalTimer("CalledShot","LOCALS",10)
END

// Ranged
IF
See([ENEMY])
HasItemEquiped("HAMM06",Myself)
!Range(NearestEnemyOf(Myself),4)
THEN
RESPONSE #100
EquipRanged()
AttackReevaluate(NearestEnemyOf(Myself),15)
END
IF
See([ENEMY])
CheckStatLT(NearestEnemyOf(Myself),100,RESISTPIERCING)
!Range(NearestEnemyOf(Myself),4)
THEN
RESPONSE #100
EquipRanged()
AttackReevaluate(NearestEnemyOf(Myself),15)
END

// Melee
IF
See([ENEMY])
Range(NearestEnemyOf(Myself),4)
THEN
RESPONSE #100
EquipMostDamagingMelee()
AttackReevaluate(NearestEnemyOf(Myself),15)
END

#3 cirerrek

cirerrek
  • Member
  • 193 posts

Posted 18 November 2002 - 07:54 AM

Weapon switching and ammo switching have always proven very difficult to implement. BIS/Bioware never saw a real need to be able to take something from your back pack and equip it in the appropriate slot, so get anything to work requires a 2X4 scripting method (hit many times very hard with a blunt object).

I would recommend dropping the Tree of Life Nuts and Good Berries from your script, not because what you have might not work, but simply because their aren't enough ToLNs to really be worthwhile and Good Berries is such a trivial spell.

You might want to take a look at these Party AI scripts to figure out how to do what you want.

http://groups.yahoo......0AI/Party AI/

check out eScript, gScript, and uScript

Another set of scripts to look at can be found here

http://www.fortuneci...s/winelodge/79/

Cirerrek