Advertisement
Rochet2

Untitled

Dec 4th, 2014
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.53 KB | None | 0 0
  1. Script:
  2. local function test()
  3.     return 1, 2, nil, nil
  4. end
  5.  
  6. function DebugSpellCast(event, player, spell, skipCheck)
  7.     print(player:GetLocation())
  8.     print(spell:GetTargetDest())
  9.     print(spell:GetTargetDest4())
  10.     print(test())
  11. end
  12. RegisterPlayerEvent(5, DebugSpellCast)
  13.  
  14. Output:
  15. -9976.318359375    603.54681396484    39.692855834961    5.5698990821838
  16. -9974.3896484375
  17. -9974.3896484375   598.3837890625     39.303981781006
  18. 1    2    nil    nil
  19.  
  20.  
  21. Implementation of the functions:
  22.     int GetTargetDest(Eluna* E, Spell* spell)
  23.     {
  24. #ifndef TRINITY
  25.         if (!(spell->m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
  26.             return 3;
  27.         float x, y, z;
  28.         spell->m_targets.getDestination(x, y, z);
  29. #else
  30.         if (!spell->m_targets.HasDst())
  31.             return 3;
  32.         float x, y, z;
  33.         spell->m_targets.GetDstPos()->GetPosition(x, y, z);
  34. #endif
  35.         Eluna::Push(E->L, x);
  36.         Eluna::Push(E->L, y);
  37.         Eluna::Push(E->L, z);
  38.         return 3;
  39.     }
  40.  
  41.     int GetTargetDest4(Eluna* E, Spell* spell)
  42.     {
  43. #ifndef TRINITY
  44.         if (!(spell->m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
  45.             return 3;
  46.         float x, y, z;
  47.         spell->m_targets.getDestination(x, y, z);
  48. #else
  49.         if (!spell->m_targets.HasDst())
  50.             return 3;
  51.         float x, y, z;
  52.         spell->m_targets.GetDstPos()->GetPosition(x, y, z);
  53. #endif
  54.         Eluna::Push(E->L, x);
  55.         Eluna::Push(E->L, y);
  56.         Eluna::Push(E->L, z);
  57.         return 3;
  58.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement