spell_teleport.qsrc 999 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #spell_teleport
  2. ! Do the stuff of a Teleport
  3. ! ARGS[0] = Success/Failure level
  4. ! ARGS[1] = the Target Location
  5. didItWork = $ARGS[0]
  6. $NewLocation = $ARGS[1]
  7. :RandLocLoop
  8. $randomLoc = $tpLocations[rand(0,arrsize($tpLocations) - 1)]
  9. if $randomLoc = $NewLocation or $randomLoc = $EntryPoint:
  10. jump 'RandLocLoop'
  11. end
  12. if didItWork > 0:
  13. *nl
  14. "The blur you see just outside the ring seems to shift."
  15. wait 1000
  16. if $treeCircArg[$NewLocation] = "":
  17. gt $treeCircLoc[$NewLocation]
  18. else:
  19. gt $treeCircLoc[$NewLocation], $treeCircArg[$NewLocation]
  20. end
  21. elseif didItWork < 0:
  22. *nl
  23. "The blur you see just outside the ring seems to shift. Something did not go right!"
  24. wait 1000
  25. if $treeCircArg[$randomLoc] = "":
  26. gt $treeCircLoc[$randomLoc]
  27. else:
  28. gt $treeCircLoc[$randomLoc], $treeCircArg[$randomLoc]
  29. end
  30. else:
  31. 'You feel drained, but the energy fizzles out and nothing happens'
  32. end
  33. killvar '$randomLoc'
  34. killvar '$NewLocation'
  35. killvar didItWork
  36. -- spell_teleport ---------------------------------