rendered paste bodyIndex: trunk/src/scriptengine/ScriptFunctions.cpp
===================================================================
--- trunk/src/scriptengine/ScriptFunctions.cpp (revision 1901)
+++ trunk/src/scriptengine/ScriptFunctions.cpp (working copy)
@@ -402,7 +402,7 @@
GM_CHECK_NUM_PARAMS(2);
GM_CHECK_INT_PARAM(spellid, 0);
- Unit * pTarget = (Unit*)a_thread->ParamUser_NoCheckTypeOrParam(1);
+ Unit * pTarget = GetThisPointer<Unit>(a_thread)->GetAIInterface()->GetMostHated();
Unit * pThis = GetThisPointer<Unit>(a_thread);
if(!pTarget)
@@ -1666,4 +1666,58 @@
pGameObject->SetInstanceID(pThis->GetInstanceID());
pGameObject->PushToWorld(pThis->GetMapMgr());
return GM_OK;
-}
\ No newline at end of file
+}
+
+int Player_BindHearth(gmThread * a_thread)
+{
+ GM_CHECK_NUM_PARAMS(5);
+ GM_CHECK_INT_PARAM(map, 0);
+ GM_CHECK_FLOAT_PARAM(X, 1);
+ GM_CHECK_FLOAT_PARAM(Y, 2);
+ GM_CHECK_FLOAT_PARAM(Z, 3);
+ GM_CHECK_INT_PARAM(zone, 4);
+ GetThisPointer<Player>(a_thread)->SetBindPoint(X,Y,Z, map, zone);
+ return GM_OK;
+
+}
+
+int Player_Silence(gmThread * a_thread)
+{
+ GM_CHECK_NUM_PARAMS(0);
+ GetThisPointer<Player>(a_thread)->m_silenced++;
+ GetThisPointer<Player>(a_thread)->m_special_state |= UNIT_STATE_SILENCE;
+ return GM_OK;
+}
+
+int Player_Unsilence(gmThread * a_thread)
+{
+ GM_CHECK_NUM_PARAMS(0);
+ GetThisPointer<Player>(a_thread)->m_silenced = 0;
+ GetThisPointer<Player>(a_thread)->m_special_state &= ~UNIT_STATE_SILENCE;
+ return GM_OK;
+}
+
+int Player_Pacified(gmThread * a_thread)
+{
+ GM_CHECK_NUM_PARAMS(0);
+ GetThisPointer<Player>(a_thread)->m_pacified++;
+ GetThisPointer<Player>(a_thread)->m_special_state |= UNIT_STATE_PACIFY;
+ return GM_OK;
+}
+
+int Player_Unpacified(gmThread * a_thread)
+{
+ GM_CHECK_NUM_PARAMS(0);
+ GetThisPointer<Player>(a_thread)->m_pacified = 0;
+ if (!GetThisPointer<Player>(a_thread)->m_pacified)
+ GetThisPointer<Player>(a_thread)->m_special_state &= ~UNIT_STATE_PACIFY;
+ return GM_OK;
+
+}
+
+int Player_GetTeam(gmThread * a_thread)
+{
+ GM_CHECK_NUM_PARAMS(0);
+ a_thread->PushInt(GetThisPointer<Player>(a_thread)->GetTeam());
+ return GM_OK;
+}
Index: trunk/src/scriptengine/ScriptFunctions.h
===================================================================
--- trunk/src/scriptengine/ScriptFunctions.h (revision 1901)
+++ trunk/src/scriptengine/ScriptFunctions.h (working copy)
@@ -73,6 +73,12 @@
int GM_CDECL Player_SetLevel(gmThread * a_thread);
int GM_CDECL Player_LevelUp(gmThread * a_thread);
int GM_CDECL Player_Kick(gmThread * a_thread);
+ int GM_CDECL Player_BindHearth(gmThread * a_thread);
+ int GM_CDECL Player_Silence(gmThread * a_thread);
+ int GM_CDECL Player_Unsilence(gmThread * a_thread);
+ int GM_CDECL Player_Pacified(gmThread * a_thread);
+ int GM_CDECL Player_Unpacified(gmThread * a_thread);
+ int GM_CDECL Player_GetTeam(gmThread * a_thread);
/* AreaTrigger Functions */
int GM_CDECL AreaTrigger_GetEntry(gmThread * a_thread);
Index: trunk/src/scriptengine/ScriptFunctionTable.cpp
===================================================================
--- trunk/src/scriptengine/ScriptFunctionTable.cpp (revision 1901)
+++ trunk/src/scriptengine/ScriptFunctionTable.cpp (working copy)
@@ -55,7 +55,14 @@
{ "SetLevel", Player_SetLevel },
{ "LevelUp", Player_LevelUp },
{ "Kick", Player_Kick },
+ { "BindHearth", Player_BindHearth },
+ { "Silence", Player_Silence },
+ { "Unsilenced", Player_Unsilence},
+ { "Pacify", Player_Pacified },
+ { "Unpacify", Player_Unpacified },
+ { "GetTeam", Player_GetTeam },
+
// Imported Unit Functions
{ "GetHealthPct", Unit_GetHealthPct },
{ "Emote", Unit_Emote },