Changeset 1142
- Timestamp:
- 02/01/2010 11:56:21 PM (5 weeks ago)
- Location:
- Trunk
- Files:
-
- 3 modified
-
LUA_ENGINE_COMMANDS.txt (modified) (3 diffs)
-
src/LuaEngine/FunctionTables.h (modified) (1 diff)
-
src/LuaEngine/UnitFunctions.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Trunk/LUA_ENGINE_COMMANDS.txt
r1136 r1142 323 323 Unit:SetPower(amount, [type]) +- Sets Unit's power. type is as above. 324 324 325 Unit:CreateCustomWaypoint(id,x,y,z,o,waittime,movementflags,modelid) +- This command creates waypoints for the creature GIVEN an id rather than generated one. movementflags are 0x0 for walk, 0x100 for run ... etc the rest is self explanatory326 Unit:DeleteWaypoints() +- Does just, erases all waypoints the unit has.325 Unit:CreateCustomWaypoint(id,x,y,z,o,waittime,movementflags,modelid) +- Same as CreateWaypoint, but allows for set ID instead of incremental. 326 Unit:DeleteWaypoints() +- Erases all waypoints that Unit has. 327 327 Plyr:LearnSpells(lua_table) +- lua_table must be an array of spell ids. The function will teach Plyr each of those spells. 328 328 ex. … … 331 331 player:LearnSpells(spellz) 332 332 end 333 Plyr:AddAchievement(ID) +- Makes Plyr complete an achievement with the specified ID. Returns true on success, false on failure. 334 Plyr:RemoveAchievement(ID) +- Removes the achievement with the specified ID from Plyr. 335 Plyr:HasAchievement(ID) +- Returns true if Plyr has completed the specified achievement, false otherwise. 333 336 334 337 :Packets … … 401 404 402 405 :QUERYRESULT 403 QResult:GetColumn(colNum) +- Returns a field object (see below) based on the column number given , errors if colNum is greater than max columns406 QResult:GetColumn(colNum) +- Returns a field object (see below) based on the column number given. Errors if colNum is greater than max columns 404 407 e.x Usage: 405 408 local qres = WorldDBQuery(...) -
Trunk/src/LuaEngine/FunctionTables.h
r1136 r1142 479 479 { "GetEquippedItemBySlot", &luaUnit::GetEquippedItemBySlot }, 480 480 { "GetGuildMembers", &luaUnit::GetGuildMembers }, 481 //{ "AddAchievement", &luaUnit::AddAchievement },482 //{ "RemoveAchievement", &luaUnit::RemoveAchievement },483 //{ "HasAchievement", &luaUnit::HasAchievement },481 { "AddAchievement", &luaUnit::AddAchievement }, 482 { "RemoveAchievement", &luaUnit::RemoveAchievement }, 483 { "HasAchievement", &luaUnit::HasAchievement }, 484 484 { "RemoveArenaPoints", &luaUnit::RemoveArenaPoints}, 485 485 { "TakeHonor", &luaUnit::TakeHonor}, -
Trunk/src/LuaEngine/UnitFunctions.h
r1137 r1142 5702 5702 } 5703 5703 5704 /*int AddAchievement(lua_State * L, Unit * ptr)5704 int AddAchievement(lua_State * L, Unit * ptr) 5705 5705 { 5706 5706 CHECK_TYPEID(TYPEID_PLAYER); 5707 5707 int32 achievementID = luaL_checkint(L,1); 5708 Player * plr = ((Player*)ptr); 5709 plr->GetAchievementMgr().GMCompleteAchievement(NULL, achievementID); 5708 Player * plr = TO_PLAYER(ptr); 5709 if (plr->GetAchievementMgr().GMCompleteAchievement(NULL, achievementID)) 5710 lua_pushboolean(L, 1); 5711 else 5712 lua_pushboolean(L, 0); 5710 5713 return 1; 5711 5714 } … … 5715 5718 CHECK_TYPEID(TYPEID_PLAYER); 5716 5719 int32 achievementID = luaL_checkint(L,1); 5717 ((Player*)ptr)->GetAchievementMgr().GMResetAchievement(achievementID);5718 return 1;5720 TO_PLAYER(ptr)->GetAchievementMgr().GMResetAchievement(achievementID); 5721 return 0; 5719 5722 } 5720 5723 … … 5723 5726 CHECK_TYPEID(TYPEID_PLAYER); 5724 5727 uint32 achievementID = luaL_checkint(L,1); 5725 lua_pushboolean(L, ((Player*)ptr)->GetAchievementMgr().HasCompleted(achievementID) ? 1 : 0);5726 return 1; 5727 } */5728 lua_pushboolean(L, TO_PLAYER(ptr)->GetAchievementMgr().HasCompleted(achievementID) ? 1 : 0); 5729 return 1; 5730 } 5728 5731 5729 5732 int GetAreaId(lua_State * L, Unit * ptr)
![(please configure the [header_logo] section in trac.ini)](/trac/arcscripts/chrome/site/your_project_logo.png)