Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Script:
- local function test()
- return 1, 2, nil, nil
- end
- function DebugSpellCast(event, player, spell, skipCheck)
- print(player:GetLocation())
- print(spell:GetTargetDest())
- print(spell:GetTargetDest4())
- print(test())
- end
- RegisterPlayerEvent(5, DebugSpellCast)
- Output:
- -9976.318359375 603.54681396484 39.692855834961 5.5698990821838
- -9974.3896484375
- -9974.3896484375 598.3837890625 39.303981781006
- 1 2 nil nil
- Implementation of the functions:
- int GetTargetDest(Eluna* E, Spell* spell)
- {
- #ifndef TRINITY
- if (!(spell->m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
- return 3;
- float x, y, z;
- spell->m_targets.getDestination(x, y, z);
- #else
- if (!spell->m_targets.HasDst())
- return 3;
- float x, y, z;
- spell->m_targets.GetDstPos()->GetPosition(x, y, z);
- #endif
- Eluna::Push(E->L, x);
- Eluna::Push(E->L, y);
- Eluna::Push(E->L, z);
- return 3;
- }
- int GetTargetDest4(Eluna* E, Spell* spell)
- {
- #ifndef TRINITY
- if (!(spell->m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
- return 3;
- float x, y, z;
- spell->m_targets.getDestination(x, y, z);
- #else
- if (!spell->m_targets.HasDst())
- return 3;
- float x, y, z;
- spell->m_targets.GetDstPos()->GetPosition(x, y, z);
- #endif
- Eluna::Push(E->L, x);
- Eluna::Push(E->L, y);
- Eluna::Push(E->L, z);
- return 3;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement