Author Topic: Bug in use item in script ?  (Read 925 times)

Offline aigleborgne

  • Planewalker
  • *****
  • Posts: 106
Bug in use item in script ?
« on: November 07, 2005, 12:40:51 PM »
Hello,

I'm having trouble in using "useitem" in my script:

IF
   GlobalTimerExpired("sanctuary","LOCALS")
   GlobalTimerExpired("castnattack","LOCALS")
   HasItemEquiped("_WAND11",Myself) // Wand of the Heavens
   CheckStatLT(LastSeenBy(Myself),40,RESISTFIRE)
   Range(LastSeenBy(Myself),100)
   See(LastSeenBy(Myself))
THEN
   RESPONSE #100
      ReallyForceSpell(LastSeenBy(Myself),CLERIC_FLAME_STRIKE)
      SetGlobalTimer("castnattack","LOCALS",6)
      DisplayStringHead(Myself,7273) // Wand of the Heavens
      UseItem("_WAND11",LastSeenBy(Myself)) // Wand of the Heavens
END

I have added the reallyforcespell to check my LastSeenBy(Myself)
Sometimes, everything work correctly. otherwise, Useitem doesn't work at all, I see the string "Wand of the Heaven", enemy stops melee and look his target.
but nothing happens  :(

With the reallyforcespell line added, the target get the flame strike.

For example, in my last test:
1 fighter, 2 mages
cleric melee the fighter, he hold one mage.
while he is meleeing, he use wand each round on the other mage
the mage died in 2 rounds
so he must use his wand on the other mage, but it doesn't work
(lastseen work because the other mage take flamstrike)

Does someones know what happens? I would be so happy to make things working :)

Offline Avenger_teambg

  • Planewalker
  • *****
  • Posts: 399
Re: Bug in use item in script ?
« Reply #1 on: November 08, 2005, 02:00:22 AM »
Instead of reallyforcespell, use displaystringhead, it is less intrusive.
Does your item have charge?


Offline aigleborgne

  • Planewalker
  • *****
  • Posts: 106
Re: Bug in use item in script ?
« Reply #2 on: November 08, 2005, 04:26:19 AM »
Yes it does have charge (11 charges initially)
I will use displaystringheads, but that's not the problem ;)

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: