Okies, there are two final problem i had left since I been meddling the whole script process up til now. ^_^
Let me explain more thoroughly now.
Two spells's chant
1)
You are done invoking your magic.
You chant the words 'Major kretsz rex xero'
The simplicity of raji aids you.
You protect Admonius.
2)
You are done invoking your magic.
You chant the words 'Rubber'
The simplicity of raji aids you.
You protect Admonius.
Problem 1:
The only difference lies only on the line 2 of each spell's chant. However, the player name, Admonius, which is the target lies in line four. I tried in vain to solve this trigger problem as I only know how to match one line only. Is they anyway to grab of the the target name and the difference in this set of spells?
Problem 2:
spellname = CDate (world.GetVariable _
(splitname (0) & "_SpellName_" & splitname (2)))
I have lots of errors inserting this two line. I figured that I must have done incorrectly and therefore, placed the entire script I been altering from yours so far...
Thanks in advance. ^_^
sub NewSpell (spellname, target, minutes)
dim number
' get a unique number
number = world.GetUniqueNumber
' Flags:
' 1 = enabled
' 4 = one shot (once only)
' 1024 = replace any of same name
' add a timer to go off after the appropriate time
world.AddTimer "SpellTimer_" & number, 0, minutes - 1, 30, "", _
1 + 4 + 1024, "OnSpellTimer"
' remember when the spell expires, the target and the spell name
world.setvariable "SpellTimer_Time_" & number, _
DateAdd ("n", minutes, Now)
world.setvariable "SpellTimer_Name_" & number, target
world.setvariable "SpellTimer_Spellname_" & number, spellname
end sub
sub OnSpellIW (strTriggerName, strTriggerLine, aryWildcards)
call NewSpell ("IW", aryWildcards (1), 15)
end sub
sub OnSpellMIPR (strTriggerName, strTriggerLine, aryWildcards)
call NewSpell ("MIPR", aryWildcards (1), 4)
end sub
sub OnSpellMAPR (strTriggerName, strTriggerLine, aryWildcards)
call NewSpell ("MAPR", aryWildcards (1), 4)
end sub
sub OnSpellTimer (strTimerName)
dim splitname
dim spellname
dim mylist
dim number
dim i
dim character
spellname = CDate (world.GetVariable _
(splitname (0) & "_SpellName_" & splitname (2)))
splitname = split (strTimerName, "_")
number = CInt (splitname (1)) ' find our unique number
mylist = world.GetVariableList
' scan variables list to find timer number
if not IsEmpty (mylist) then
for i = lbound (mylist) to ubound (mylist)
splitname = split (mylist (i), "_")
if ubound (splitname) = 2 then
if splitname (0) = "spelltimer" and splitname (1) = "name" then
if CInt (splitname (2)) = number then
' work out character name
character = world.GetVariable (mylist (i))
' tell them time is up
world.send "party say " & spellname & " spell on " _
& character & ", left 30 seconds (DANGER)"
' delete associated variables
world.deletevariable splitname (0) & "_Name_" & splitname (2)
world.deletevariable splitname (0) & "_Time_" & splitname (2)
end if
end if ' found a spelltimer variable
end if ' split into 3 pieces
next ' end of loop
End If ' have any variables
end sub
sub OnSpellQuery (thename, theoutput, thewildcards)
dim mylist
dim i
dim splitname
dim spellname
dim endtime
dim timeleft
dim character
mylist = world.GetVariableList
spellname = CDate (world.GetVariable _
(splitname (0) & "_SpellName_" & splitname (2)))
if not IsEmpty (mylist) then
for i = lbound (mylist) to ubound (mylist)
splitname = split (mylist (i), "_")
if ubound (splitname) = 2 then
if splitname (0) = "spelltimer" and splitname (1) = "name" then
starttime = CDate (world.GetVariable _
(splitname (0) & "_Time_" & splitname (2)))
character = world.GetVariable (mylist (i))
timeleft = DateDiff("s", Now, endtime)
if timeleft > 0 then
world.send "party say " & spellname & " spell on " _
& character & ", left " _
& timeleft & " seconds" (TIMER)
end if
end if ' found a spelltimer variable
end if ' split into 3 pieces
next ' end of loop
End If ' have any variables
end sub
|