Changeset 1144
- Timestamp:
- 02/02/2010 10:08:39 PM (7 months ago)
- Location:
- Trunk/src/LuaEngine
- Files:
-
- 5 modified
-
FunctionTables.h (modified) (8 diffs)
-
GameobjectFunctions.h (modified) (22 diffs)
-
LUAEngine.cpp (modified) (10 diffs)
-
LUAEngine.h (modified) (4 diffs)
-
UnitFunctions.h (modified) (23 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Trunk/src/LuaEngine/FunctionTables.h
r1142 r1144 80 80 { "SetMovementType", &luaUnit::SetMovementType }, 81 81 { "CastSpell", &luaUnit::CastSpell }, 82 { "FullCastSpell", &luaUnit::FullCastSpell },83 { "FullCastSpellOnTarget", &luaUnit::FullCastSpellOnTarget },84 82 { "SpawnCreature", &luaUnit::SpawnCreature }, 85 83 { "SpawnGameObject", &luaUnit::SpawnGameObject }, … … 128 126 { "MoveToWaypoint", &luaUnit::MoveToWaypoint }, 129 127 { "DestroyCustomWaypointMap", &luaUnit::DestroyCustomWaypointMap }, 130 { "SetCombatCapable", &luaUnit:: SetCombatCapable},131 { "SetCombatMeleeCapable", &luaUnit:: SetCombatMeleeCapable },132 { "SetCombatRangedCapable", &luaUnit:: SetCombatRangedCapable},133 { "SetCombatSpellCapable", &luaUnit:: SetCombatSpellCapable},134 { "SetCombatTargetingCapable", &luaUnit:: SetCombatTargetingCapable},128 { "SetCombatCapable", &luaUnit::DisableCombat }, 129 { "SetCombatMeleeCapable", &luaUnit::DisableMelee }, 130 { "SetCombatRangedCapable", &luaUnit::DisableRanged }, 131 { "SetCombatSpellCapable", &luaUnit::DisableSpells }, 132 { "SetCombatTargetingCapable", &luaUnit::DisableTargeting }, 135 133 { "SetNPCFlags", &luaUnit::SetNPCFlags }, 136 134 { "SetModel", &luaUnit::SetModel }, … … 313 311 { "ResetAllTalents", &luaUnit::ResetAllTalents }, 314 312 { "GetAccountName", &luaUnit::GetAccountName }, 315 //NA: { "GetGamemasterLevel", &luaUnit::GetGamemasterLevel },316 313 { "SavePlayer", &luaUnit::SavePlayer }, 317 314 { "HasQuest", &luaUnit::HasQuest }, … … 341 338 { "GetNativeDisplay", &luaUnit::GetNativeDisplay }, 342 339 { "IsMounted", &luaUnit::IsMounted }, 343 //hypersniper added commands 344 { "GetGameTime", &luaUnit::GetGameTime }, 345 { "PlaySoundToPlayer", &luaUnit::PlaySoundToPlayer }, 346 { "GetDuelState", &luaUnit::GetDuelState }, 347 { "SetPosition", &luaUnit::SetPosition}, 348 { "CastSpellOnTarget", &luaUnit::CastSpellOnTarget}, 349 { "GetLandHeight", &luaUnit::GetLandHeight}, 350 { "QuestAddStarter", &luaUnit::QuestAddStarter}, 351 { "QuestAddFinisher", &luaUnit::QuestAddFinisher}, 352 { "SetPlayerSpeed", &luaUnit::SetPlayerSpeed}, 353 { "GiveHonor", &luaUnit::GiveHonor}, 354 { "SetBindPoint", &luaUnit::SetBindPoint}, 355 { "SoftDisconnect", &luaUnit::SoftDisconnect}, 356 { "SetZoneWeather", &luaUnit::SetZoneWeather}, 357 { "SetPlayerWeather", &luaUnit::SetPlayerWeather}, 358 { "SendPacketToPlayer", &luaUnit::SendPacketToPlayer}, 359 { "SendPacketToZone", &luaUnit::SendPacketToZone}, 360 { "SendPacketToWorld", &luaUnit::SendPacketToWorld}, 361 { "SendPacketToInstance", &luaUnit::SendPacketToInstance}, 362 { "PlayerSendChatMessage", &luaUnit::PlayerSendChatMessage}, 363 { "GetDistanceYards", &luaUnit::GetDistanceYards}, 364 { "VendorAddItem", &luaUnit::VendorAddItem}, 365 { "VendorRemoveItem", &luaUnit::VendorRemoveItem}, 366 { "VendorRemoveAllItems", &luaUnit::VendorRemoveAllItems}, 367 { "CreatureHasQuest", &luaUnit::CreatureHasQuest}, 368 { "SendVendorWindow", &luaUnit::SendVendorWindow}, 369 { "SendTrainerWindow", &luaUnit::SendTrainerWindow}, 370 { "SendInnkeeperWindow", &luaUnit::SendInnkeeperWindow}, 371 { "SendBankWindow", &luaUnit::SendBankWindow}, 372 { "SendAuctionWindow", &luaUnit::SendAuctionWindow}, 373 { "SendBattlegroundWindow", &luaUnit::SendBattlegroundWindow}, 374 { "GetInventoryItem", &luaUnit::GetInventoryItem}, 375 { "GetInventoryItemById", &luaUnit::GetInventoryItemById}, 376 { "PhaseSet", &luaUnit::PhaseSet}, 377 { "PhaseAdd", &luaUnit::PhaseAdd}, 378 { "PhaseDelete", &luaUnit::PhaseDelete}, 379 { "GetPhase", &luaUnit::GetPhase}, 380 { "AggroWithInRangeFriends", &luaUnit::AggroWithInRangeFriends}, 381 { "GetPrimaryCombatTarget", &luaUnit::GetPrimaryCombatTarget}, 382 { "MoveRandomArea", &luaUnit::MoveRandomArea}, 383 { "SendLootWindow", &luaUnit::SendLootWindow}, 384 { "AddLoot", &luaUnit::AddLoot}, 385 { "SetPacified", &luaUnit::SetPacified}, 386 { "SpawnVehicle", &luaUnit::SpawnVehicle}, 387 { "SetVehicle", &luaUnit::SetVehicle}, 388 { "GetVehicle", &luaUnit::GetVehicle}, 389 { "RemoveFromVehicle", &luaUnit::RemoveFromVehicle}, 390 { "GetVehicleSeat", &luaUnit::GetVehicleSeat}, 391 { "IsVehicle", &luaUnit::IsVehicle}, 392 { "GetPassengerCount", &luaUnit::GetPassengerCount}, 393 { "MoveVehicle", &luaUnit::MoveVehicle}, 394 { "SetPlayerLock", &luaUnit::SetPlayerLock}, 395 //3004 ends here 396 { "GetGroupPlayers", &luaUnit::GetGroupPlayers}, 397 { "IsGm", &luaUnit::IsGm}, 398 { "GetDungeonDifficulty", &luaUnit::GetDungeonDifficulty}, 399 { "GetGroupLeader", &luaUnit::GetGroupLeader}, 400 { "SetGroupLeader", &luaUnit::SetGroupLeader}, 401 { "AddGroupMember", &luaUnit::AddGroupMember}, 402 { "SetDungeonDifficulty", &luaUnit::SetDungeonDifficulty}, 403 { "ExpandToRaid", &luaUnit::ExpandToRaid}, 404 { "SendPacketToGroup", &luaUnit::SendPacketToGroup}, 405 { "IsGroupFull", &luaUnit::IsGroupFull}, 406 //next 9 credit: Alvanaar 407 { "IsGroupedWith", &luaUnit::IsGroupedWith}, 408 { "GetTotalHonor", &luaUnit::GetTotalHonor}, 409 { "GetHonorToday", &luaUnit::GetHonorToday}, 410 { "GetHonorYesterday", &luaUnit::GetHonorYesterday}, 411 { "GetArenaPoints", &luaUnit::GetArenaPoints}, 412 { "AddArenaPoints", &luaUnit::AddArenaPoints}, 413 { "AddLifetimeKills", &luaUnit::AddLifetimeKills}, 414 { "GetGender", &luaUnit::GetGender}, //9 415 { "SetGender", &luaUnit::SetGender}, 416 { "GetGroupType", &luaUnit::GetGroupType}, 417 //next 5: cred alvanaar 418 { "SendPacketToGuild", &luaUnit::SendPacketToGuild }, 419 { "GetGuildId", &luaUnit::GetGuildId }, 420 { "GetGuildRank", &luaUnit::GetGuildRank }, 421 { "SetGuildRank", &luaUnit::SetGuildRank }, 422 { "IsInGuild", &luaUnit::IsInGuild }, //5 423 { "SendGuildInvite", &luaUnit::SendGuildInvite }, 424 { "DemoteGuildMember", &luaUnit::DemoteGuildMember }, 425 { "PromoteGuildMember", &luaUnit::PromoteGuildMember }, 426 { "SetGuildMotd", &luaUnit::SetGuildMotd }, 427 { "GetGuildMotd", &luaUnit::GetGuildMotd }, 428 { "SetGuildInformation", &luaUnit::SetGuildInformation }, 429 { "AddGuildMember", &luaUnit::AddGuildMember }, 430 { "RemoveGuildMember", &luaUnit::RemoveGuildMember }, 431 { "SetPublicNote", &luaUnit::SetPublicNote }, 432 { "SetOfficerNote", &luaUnit::SetOfficerNote }, 433 { "DisbandGuild", &luaUnit::DisbandGuild }, 434 { "ChangeGuildMaster", &luaUnit::ChangeGuildMaster }, 435 { "SendGuildChatMessage", &luaUnit::SendGuildChatMessage }, 436 { "SendGuildLog", &luaUnit::SendGuildLog }, 437 { "GuildBankDepositMoney", &luaUnit::GuildBankDepositMoney }, 438 { "GuildBankWithdrawMoney", &luaUnit::GuildBankWithdrawMoney }, 439 { "GetInstanceOwner", &luaUnit::GetInstanceOwner }, 440 { "GetGmRank", &luaUnit::GetGmRank }, 441 { "SetByteValue", &luaUnit::SetByteValue }, 442 { "GetByteValue", &luaUnit::GetByteValue }, 443 { "IsPvPFlagged", &luaUnit::IsPvPFlagged }, 444 { "IsFFAPvPFlagged", &luaUnit::IsFFAPvPFlagged }, 445 { "GetGuildLeader", &luaUnit::GetGuildLeader }, 446 { "GetGuildMemberCount", &luaUnit::GetGuildMemberCount }, 447 { "CanAttack", &luaUnit::CanAttack }, 448 { "GetInRangeUnits", &luaUnit::GetInRangeUnits }, 449 { "GetInRangeEnemies", &luaUnit::GetInRangeEnemies }, 450 { "IsFriendly", &luaUnit::IsFriendly }, 451 { "MovePlayerTo", &luaUnit::MovePlayerTo }, 452 // next 15 - Alvanaar 453 //{ "IsInChannel", &luaUnit::IsInChannel }, 454 //{ "JoinChannel", &luaUnit::JoinChannel }, 455 //{ "LeaveChannel", &luaUnit::LeaveChannel }, 456 //{ "SetChannelOwner", &luaUnit::SetChannelOwner }, 457 //{ "GetChannelOwner", &luaUnit::GetChannelOwner }, 458 //{ "SendPacketToChannel", &luaUnit::SendPacketToChannel }, 459 //{ "SetChannelName", &luaUnit::SetChannelName }, 460 //{ "SetChannelPassword", &luaUnit::SetChannelPassword }, 461 //{ "GetChannelPassword", &luaUnit::GetChannelPassword }, 462 //{ "GetChannelOwner", &luaUnit::GetChannelOwner }, 463 //{ "KickFromChannel", &luaUnit::KickFromChannel }, 464 //{ "BanFromChannel", &luaUnit::BanFromChannel }, 465 //{ "UnbanFromChannel", &luaUnit::UnbanFromChannel }, 466 //{ "GetChannelMemberCount", &luaUnit::GetChannelMemberCount }, 467 //{ "GetChannelMembers", &luaUnit::GetChannelMembers }, 468 { "GetPlayerMovementVector", &luaUnit::GetPlayerMovementVector}, 469 { "UnsetKnownTitle", &luaUnit::UnsetKnownTitle}, 470 { "IsInPhase", &luaUnit::IsInPhase}, 471 { "HasFlag", &luaUnit::HasFlag }, 472 { "Repop", &luaUnit::Repop }, 473 { "SetMovementFlags", &luaUnit::SetMovementFlags }, 474 { "GetSpawnId", &luaUnit::GetSpawnId }, 475 { "ResetTalents", &luaUnit::ResetTalents }, 476 { "SetTalentPoints", &luaUnit::SetTalentPoints }, 477 { "GetTalentPoints", &luaUnit::GetTalentPoints }, 478 { "EventChat", &luaUnit::EventChat }, 479 { "GetEquippedItemBySlot", &luaUnit::GetEquippedItemBySlot }, 480 { "GetGuildMembers", &luaUnit::GetGuildMembers }, 481 { "AddAchievement", &luaUnit::AddAchievement }, 482 { "RemoveAchievement", &luaUnit::RemoveAchievement }, 483 { "HasAchievement", &luaUnit::HasAchievement }, 484 { "RemoveArenaPoints", &luaUnit::RemoveArenaPoints}, 485 { "TakeHonor", &luaUnit::TakeHonor}, 486 { "SetPhase", &luaUnit::PhaseSet}, 487 { "DeletePhase", &luaUnit::PhaseDelete}, 488 { "AddToPhase", &luaUnit::PhaseAdd}, 489 { "GetAreaId", &luaUnit::GetAreaId}, 490 { "ResetPetTalents", &luaUnit::ResetPetTalents}, 491 { "IsDazed", &luaUnit::IsDazed }, 492 { "GetAura", &luaUnit::GetAura }, 493 { "IsRooted", &luaUnit::IsRooted }, 494 { "HasAuraWithMechanic", &luaUnit::HasAuraWithMechanic }, 495 { "HasNegativeAura", &luaUnit::HasNegativeAura }, 496 { "HasPositiveAura", &luaUnit::HasPositiveAura }, 497 { "SetActionBar", &luaUnit::SetActionBar }, 498 { "GetClosestEnemy", &luaUnit::GetClosestEnemy }, 499 { "GetClosestFriend", &luaUnit::GetClosestFriend }, 500 { "IsOnTaxi", &luaUnit::IsOnTaxi }, 501 { "GetTaxi", &luaUnit::GetTaxi }, 502 { "GetObjectType", &luaUnit::GetObjectType }, 503 { "CreateCustomWaypoint", &luaUnit::CreateCustomWaypoint }, 504 { "DeleteWaypoints", &luaUnit::DeleteAllWaypoints }, 505 { "GiveXp", &luaUnit::GiveXp }, 506 { "GetPower", &luaUnit::GetPower }, 507 { "GetPowerPct", &luaUnit::GetPowerPct }, 508 { "GetMaxPower", &luaUnit::GetMaxPower }, 509 { "SetPower", &luaUnit::SetPower }, 510 { "SetPowerPct", &luaUnit::SetPowerPct }, 511 { "SetMaxPower", &luaUnit::SetMaxPower }, 512 { "LearnSpells", &luaUnit::LearnSpells }, 513 { NULL, NULL }, 340 //hypersniper added commands 341 { "GetGameTime", &luaUnit::GetGameTime }, 342 { "PlaySoundToPlayer", &luaUnit::PlaySoundToPlayer }, 343 { "GetDuelState", &luaUnit::GetDuelState }, 344 { "SetPosition", &luaUnit::SetPosition}, 345 { "CastSpellOnTarget", &luaUnit::CastSpellOnTarget}, 346 { "GetLandHeight", &luaUnit::GetLandHeight}, 347 { "QuestAddStarter", &luaUnit::QuestAddStarter}, 348 { "QuestAddFinisher", &luaUnit::QuestAddFinisher}, 349 { "SetPlayerSpeed", &luaUnit::SetPlayerSpeed}, 350 { "GiveHonor", &luaUnit::GiveHonor}, 351 { "SetBindPoint", &luaUnit::SetBindPoint}, 352 { "SoftDisconnect", &luaUnit::SoftDisconnect}, 353 { "SetZoneWeather", &luaUnit::SetZoneWeather}, 354 { "SetPlayerWeather", &luaUnit::SetPlayerWeather}, 355 { "SendPacketToPlayer", &luaUnit::SendPacketToPlayer}, 356 { "SendPacketToZone", &luaUnit::SendPacketToZone}, 357 { "SendPacketToWorld", &luaUnit::SendPacketToWorld}, 358 { "SendPacketToInstance", &luaUnit::SendPacketToInstance}, 359 { "PlayerSendChatMessage", &luaUnit::PlayerSendChatMessage}, 360 { "GetDistanceYards", &luaUnit::GetDistanceYards}, 361 { "VendorAddItem", &luaUnit::VendorAddItem}, 362 { "VendorRemoveItem", &luaUnit::VendorRemoveItem}, 363 { "VendorRemoveAllItems", &luaUnit::VendorRemoveAllItems}, 364 { "CreatureHasQuest", &luaUnit::CreatureHasQuest}, 365 { "SendVendorWindow", &luaUnit::SendVendorWindow}, 366 { "SendTrainerWindow", &luaUnit::SendTrainerWindow}, 367 { "SendInnkeeperWindow", &luaUnit::SendInnkeeperWindow}, 368 { "SendBankWindow", &luaUnit::SendBankWindow}, 369 { "SendAuctionWindow", &luaUnit::SendAuctionWindow}, 370 { "SendBattlegroundWindow", &luaUnit::SendBattlegroundWindow}, 371 { "GetInventoryItem", &luaUnit::GetInventoryItem}, 372 { "GetInventoryItemById", &luaUnit::GetInventoryItemById}, 373 { "PhaseSet", &luaUnit::PhaseSet}, 374 { "PhaseAdd", &luaUnit::PhaseAdd}, 375 { "PhaseDelete", &luaUnit::PhaseDelete}, 376 { "GetPhase", &luaUnit::GetPhase}, 377 { "AggroWithInRangeFriends", &luaUnit::AggroWithInRangeFriends}, 378 { "GetPrimaryCombatTarget", &luaUnit::GetPrimaryCombatTarget}, 379 { "MoveRandomArea", &luaUnit::MoveRandomArea}, 380 { "SendLootWindow", &luaUnit::SendLootWindow}, 381 { "AddLoot", &luaUnit::AddLoot}, 382 { "SetPacified", &luaUnit::SetPacified}, 383 { "SpawnVehicle", &luaUnit::SpawnVehicle}, 384 { "SetVehicle", &luaUnit::SetVehicle}, 385 { "GetVehicle", &luaUnit::GetVehicle}, 386 { "RemoveFromVehicle", &luaUnit::RemoveFromVehicle}, 387 { "GetVehicleSeat", &luaUnit::GetVehicleSeat}, 388 { "IsVehicle", &luaUnit::IsVehicle}, 389 { "GetPassengerCount", &luaUnit::GetPassengerCount}, 390 { "MoveVehicle", &luaUnit::MoveVehicle}, 391 { "SetPlayerLock", &luaUnit::SetPlayerLock}, 392 //3004 ends here 393 { "GetGroupPlayers", &luaUnit::GetGroupPlayers}, 394 { "IsGm", &luaUnit::IsGm}, 395 { "GetDungeonDifficulty", &luaUnit::GetDungeonDifficulty}, 396 { "GetGroupLeader", &luaUnit::GetGroupLeader}, 397 { "SetGroupLeader", &luaUnit::SetGroupLeader}, 398 { "AddGroupMember", &luaUnit::AddGroupMember}, 399 { "SetDungeonDifficulty", &luaUnit::SetDungeonDifficulty}, 400 { "ExpandToRaid", &luaUnit::ExpandToRaid}, 401 { "SendPacketToGroup", &luaUnit::SendPacketToGroup}, 402 { "IsGroupFull", &luaUnit::IsGroupFull}, 403 //next 9 credit: Alvanaar 404 { "IsGroupedWith", &luaUnit::IsGroupedWith}, 405 { "GetTotalHonor", &luaUnit::GetTotalHonor}, 406 { "GetHonorToday", &luaUnit::GetHonorToday}, 407 { "GetHonorYesterday", &luaUnit::GetHonorYesterday}, 408 { "GetArenaPoints", &luaUnit::GetArenaPoints}, 409 { "AddArenaPoints", &luaUnit::AddArenaPoints}, 410 { "AddLifetimeKills", &luaUnit::AddLifetimeKills}, 411 { "GetGender", &luaUnit::GetGender}, //9 412 { "SetGender", &luaUnit::SetGender}, 413 { "GetGroupType", &luaUnit::GetGroupType}, 414 //next 5: cred alvanaar 415 { "SendPacketToGuild", &luaUnit::SendPacketToGuild }, 416 { "GetGuildId", &luaUnit::GetGuildId }, 417 { "GetGuildRank", &luaUnit::GetGuildRank }, 418 { "SetGuildRank", &luaUnit::SetGuildRank }, 419 { "IsInGuild", &luaUnit::IsInGuild }, //5 420 { "SendGuildInvite", &luaUnit::SendGuildInvite }, 421 { "DemoteGuildMember", &luaUnit::DemoteGuildMember }, 422 { "PromoteGuildMember", &luaUnit::PromoteGuildMember }, 423 { "SetGuildMotd", &luaUnit::SetGuildMotd }, 424 { "GetGuildMotd", &luaUnit::GetGuildMotd }, 425 { "SetGuildInformation", &luaUnit::SetGuildInformation }, 426 { "AddGuildMember", &luaUnit::AddGuildMember }, 427 { "RemoveGuildMember", &luaUnit::RemoveGuildMember }, 428 { "SetPublicNote", &luaUnit::SetPublicNote }, 429 { "SetOfficerNote", &luaUnit::SetOfficerNote }, 430 { "DisbandGuild", &luaUnit::DisbandGuild }, 431 { "ChangeGuildMaster", &luaUnit::ChangeGuildMaster }, 432 { "SendGuildChatMessage", &luaUnit::SendGuildChatMessage }, 433 { "SendGuildLog", &luaUnit::SendGuildLog }, 434 { "GuildBankDepositMoney", &luaUnit::GuildBankDepositMoney }, 435 { "GuildBankWithdrawMoney", &luaUnit::GuildBankWithdrawMoney }, 436 { "GetInstanceOwner", &luaUnit::GetInstanceOwner }, 437 { "GetGmRank", &luaUnit::GetGmRank }, 438 { "SetByteValue", &luaUnit::SetByteValue }, 439 { "GetByteValue", &luaUnit::GetByteValue }, 440 { "IsPvPFlagged", &luaUnit::IsPvPFlagged }, 441 { "IsFFAPvPFlagged", &luaUnit::IsFFAPvPFlagged }, 442 { "GetGuildLeader", &luaUnit::GetGuildLeader }, 443 { "GetGuildMemberCount", &luaUnit::GetGuildMemberCount }, 444 { "CanAttack", &luaUnit::CanAttack }, 445 { "GetInRangeUnits", &luaUnit::GetInRangeUnits }, 446 { "GetInRangeEnemies", &luaUnit::GetInRangeEnemies }, 447 { "IsFriendly", &luaUnit::IsFriendly }, 448 { "MovePlayerTo", &luaUnit::MovePlayerTo }, 449 // next 15 - Alvanaar 450 //{ "IsInChannel", &luaUnit::IsInChannel }, 451 //{ "JoinChannel", &luaUnit::JoinChannel }, 452 //{ "LeaveChannel", &luaUnit::LeaveChannel }, 453 //{ "SetChannelOwner", &luaUnit::SetChannelOwner }, 454 //{ "GetChannelOwner", &luaUnit::GetChannelOwner }, 455 //{ "SendPacketToChannel", &luaUnit::SendPacketToChannel }, 456 //{ "SetChannelName", &luaUnit::SetChannelName }, 457 //{ "SetChannelPassword", &luaUnit::SetChannelPassword }, 458 //{ "GetChannelPassword", &luaUnit::GetChannelPassword }, 459 //{ "GetChannelOwner", &luaUnit::GetChannelOwner }, 460 //{ "KickFromChannel", &luaUnit::KickFromChannel }, 461 //{ "BanFromChannel", &luaUnit::BanFromChannel }, 462 //{ "UnbanFromChannel", &luaUnit::UnbanFromChannel }, 463 //{ "GetChannelMemberCount", &luaUnit::GetChannelMemberCount }, 464 //{ "GetChannelMembers", &luaUnit::GetChannelMembers }, 465 { "GetPlayerMovementVector", &luaUnit::GetPlayerMovementVector}, 466 { "UnsetKnownTitle", &luaUnit::UnsetKnownTitle}, 467 { "IsInPhase", &luaUnit::IsInPhase}, 468 { "HasFlag", &luaUnit::HasFlag }, 469 { "Repop", &luaUnit::Repop }, 470 { "SetMovementFlags", &luaUnit::SetMovementFlags }, 471 { "GetSpawnId", &luaUnit::GetSpawnId }, 472 { "ResetTalents", &luaUnit::ResetTalents }, 473 { "SetTalentPoints", &luaUnit::SetTalentPoints }, 474 { "GetTalentPoints", &luaUnit::GetTalentPoints }, 475 { "EventChat", &luaUnit::EventChat }, 476 { "GetEquippedItemBySlot", &luaUnit::GetEquippedItemBySlot }, 477 { "GetGuildMembers", &luaUnit::GetGuildMembers }, 478 //{ "AddAchievement", &luaUnit::AddAchievement }, 479 //{ "RemoveAchievement", &luaUnit::RemoveAchievement }, 480 //{ "HasAchievement", &luaUnit::HasAchievement }, 481 { "RemoveArenaPoints", &luaUnit::RemoveArenaPoints}, 482 { "TakeHonor", &luaUnit::TakeHonor}, 483 { "SetPhase", &luaUnit::PhaseSet}, 484 { "DeletePhase", &luaUnit::PhaseDelete}, 485 { "AddToPhase", &luaUnit::PhaseAdd}, 486 { "GetAreaId", &luaUnit::GetAreaId}, 487 { "ResetPetTalents", &luaUnit::ResetPetTalents}, 488 { "IsDazed", &luaUnit::IsDazed }, 489 { "GetAura", &luaUnit::GetAura }, 490 { "IsRooted", &luaUnit::IsRooted }, 491 { "HasAuraWithMechanic", &luaUnit::HasAuraWithMechanic }, 492 { "HasNegativeAura", &luaUnit::HasNegativeAura }, 493 { "HasPositiveAura", &luaUnit::HasPositiveAura }, 494 { "SetActionBar", &luaUnit::SetActionBar }, 495 { "GetClosestEnemy", &luaUnit::GetClosestEnemy }, 496 { "GetClosestFriend", &luaUnit::GetClosestFriend }, 497 { "IsOnTaxi", &luaUnit::IsOnTaxi }, 498 { "GetTaxi", &luaUnit::GetTaxi }, 499 { "GetObjectType", &luaUnit::GetObjectType }, 500 { "CreateCustomWaypoint", &luaUnit::CreateCustomWaypoint }, 501 { "DeleteWaypoints", &luaUnit::DeleteAllWaypoints }, 502 { "GiveXp", &luaUnit::GiveXp }, 503 { "GetPower", &luaUnit::GetPower }, 504 { "GetPowerPct", &luaUnit::GetPowerPct }, 505 { "GetMaxPower", &luaUnit::GetMaxPower }, 506 { "SetPower", &luaUnit::SetPower }, 507 { "SetPowerPct", &luaUnit::SetPowerPct }, 508 { "SetMaxPower", &luaUnit::SetMaxPower }, 509 { "LearnSpells", &luaUnit::LearnSpells }, 510 { "GetCurrentWaypoint", &luaUnit::GetCurrentWaypoint }, 511 { "GetSelectedGO", &luaUnit::GetSelectedGO }, 512 { "FullCastSpell", &luaUnit::FullCastSpell }, 513 { "FullCastSpellOnTarget", &luaUnit::FullCastSpellOnTarget }, 514 { "DisableMelee", &luaUnit::DisableMelee }, 515 { "DisableRanged", &luaUnit::DisableRanged }, 516 { "DisableSpells", &luaUnit::DisableSpells }, 517 { "DisableCombat", &luaUnit::DisableCombat }, 518 { "DisableTargeting", &luaUnit::DisableTargeting }, 519 { "IsInGroup", &luaUnit::IsInGroup }, 520 { NULL, NULL }, 514 521 }; 515 516 517 518 522 519 523 RegType<GameObject> GOMethods[] = { … … 556 560 { "ModUInt32Value", &luaGameObject::ModUInt32Value }, 557 561 { "CastSpell", &luaGameObject::CastSpell }, 558 { "FullCastSpell", &luaGameObject::FullCastSpell },559 562 { "CastSpellOnTarget", &luaGameObject::CastSpellOnTarget }, 560 { "FullCastSpellOnTarget", &luaGameObject::FullCastSpellOnTarget },561 563 { "GossipObjectCreateMenu", &luaGameObject::GossipCreateMenu }, 562 564 { "GossipObjectMenuAddItem", &luaGameObject::GossipMenuAddItem }, … … 564 566 { "GossipObjectComplete", &luaGameObject::GossipComplete }, 565 567 { "GossipObjectSendPOI", &luaGameObject::GossipSendPOI }, 566 //{ "EventCastSpell", &luaGameObject::EventCastSpell },567 568 { "RegisterAIUpdateEvent", &luaGameObject::RegisterAIUpdate }, 568 569 { "ModifyAIUpdateEvent", &luaGameObject::ModAIUpdate }, … … 577 578 { "DespawnObject", &luaGameObject::DespawnObject }, 578 579 //hypersniper's 579 { "GetGameTime", &luaGameObject::GetGameTime },580 { "GetLandHeight", &luaGameObject::GetLandHeight},581 { "SetZoneWeather", &luaGameObject::SetZoneWeather},582 { "PhaseSet", &luaGameObject::PhaseSet},583 { "PhaseAdd", &luaGameObject::PhaseAdd},584 { "PhaseDelete", &luaGameObject::PhaseDelete},585 { "GetPhase", &luaGameObject::GetPhase},580 { "GetGameTime", &luaGameObject::GetGameTime }, 581 { "GetLandHeight", &luaGameObject::GetLandHeight}, 582 { "SetZoneWeather", &luaGameObject::SetZoneWeather}, 583 { "PhaseSet", &luaGameObject::PhaseSet}, 584 { "PhaseAdd", &luaGameObject::PhaseAdd}, 585 { "PhaseDelete", &luaGameObject::PhaseDelete}, 586 { "GetPhase", &luaGameObject::GetPhase}, 586 587 { "SendPacket", luaGameObject::SendPacket }, 587 { "SendPacketToZone", &luaGameObject::SendPacketToZone}, 588 { "SendPacketToWorld", &luaGameObject::SendPacketToWorld}, 589 { "SendPacketToInstance", &luaGameObject::SendPacketToInstance}, 590 { "AddLoot", &luaGameObject::AddLoot}, 591 //3004 ends here 592 { "Update", &luaGameObject::Update}, //sadikum 593 { "GetInstanceOwner", &luaGameObject::GetInstanceOwner }, 594 { "GetDungeonDifficulty", &luaGameObject::GetDungeonDifficulty }, 595 { "SetDungeonDifficulty", &luaGameObject::SetDungeonDifficulty }, 596 { "SetByteValue", &luaGameObject::SetByteValue }, 597 { "GetByteValue", &luaGameObject::GetByteValue }, 598 { "HasFlag", &luaGameObject::HasFlag }, 599 { "IsInPhase", &luaGameObject::IsInPhase}, 600 { "SetPhase", &luaGameObject::PhaseSet}, 601 { "DeletePhase", &luaGameObject::PhaseDelete}, 602 { "AddToPhase", &luaGameObject::PhaseAdd}, 588 { "SendPacketToZone", &luaGameObject::SendPacketToZone}, 589 { "SendPacketToWorld", &luaGameObject::SendPacketToWorld}, 590 { "SendPacketToInstance", &luaGameObject::SendPacketToInstance}, 591 { "AddLoot", &luaGameObject::AddLoot}, 592 //3004 ends here 593 { "Update", &luaGameObject::Update}, //sadikum 594 { "GetInstanceOwner", &luaGameObject::GetInstanceOwner }, 595 { "GetDungeonDifficulty", &luaGameObject::GetDungeonDifficulty }, 596 { "SetDungeonDifficulty", &luaGameObject::SetDungeonDifficulty }, 597 { "HasFlag", &luaGameObject::HasFlag }, 598 { "IsInPhase", &luaGameObject::IsInPhase}, 599 { "SetPhase", &luaGameObject::PhaseSet}, 600 { "DeletePhase", &luaGameObject::PhaseDelete}, 601 { "AddToPhase", &luaGameObject::PhaseAdd}, 603 602 { "GetAreaId", &luaGameObject::GetAreaId}, 604 603 { "SetPosition", &luaGameObject::SetPosition}, … … 608 607 { "GetDistanceYards", &luaGameObject::GetDistanceYards }, 609 608 { "GetSpawnId", &luaGameObject::GetSpawnId }, 609 { "ChangeScale", &luaGameObject::ChangeScale }, 610 { "GetByte", &luaGameObject::GetByte }, 611 { "GetByteValue", &luaGameObject::GetByte }, 612 { "SetByte", &luaGameObject::SetByte }, 613 { "SetByteValue", &luaGameObject::SetByte }, 614 { "FullCastSpell", &luaGameObject::FullCastSpell }, 615 { "FullCastSpellOnTarget", &luaGameObject::FullCastSpellOnTarget }, 616 { "CustomAnimate", &luaGameObject::CustomAnimate }, 610 617 { NULL, NULL }, 611 618 }; -
Trunk/src/LuaEngine/GameobjectFunctions.h
r1136 r1144 261 261 int SpawnCreature(lua_State * L, GameObject * ptr) 262 262 { 263 if (ptr == NULL) return 0; 264 uint32 entry_id = luaL_checkint(L, 1); 265 float x = CHECK_FLOAT(L, 2); 266 float y = CHECK_FLOAT(L, 3); 267 float z = CHECK_FLOAT(L, 4); 268 float o = CHECK_FLOAT(L, 5); 269 uint32 faction = luaL_checkint(L, 6); 270 uint32 duration = luaL_checkint(L, 7); 271 272 if (!entry_id || !faction) //Shady: is it really required? 273 { 274 lua_pushnil(L); 275 return 1; 276 } 277 CreatureProto *p = CreatureProtoStorage.LookupEntry(entry_id); 278 279 if (p == NULL) 280 return 0; 281 282 Creature *pCreature = ptr->GetMapMgr()->CreateCreature(entry_id); 283 if(pCreature == NULL) 284 { 285 lua_pushnil(L); 286 return 1; 287 } 288 pCreature->spawnid = 0; 289 pCreature->m_spawn = 0; 290 pCreature->Load(p,x,y,z); 291 if (faction) 292 pCreature->SetFaction(faction); 293 pCreature->_setFaction(); 294 pCreature->SetMapId(ptr->GetMapId()); 295 pCreature->SetOrientation(o); 296 pCreature->Despawn(duration, 0); 297 pCreature->SetInstanceID(ptr->GetInstanceID()); 298 pCreature->PushToWorld(ptr->GetMapMgr()); 299 if (duration) 300 { 301 pCreature->Despawn(duration,0); 302 } 303 PUSH_UNIT(L,pCreature); 304 return 1; 305 } 306 307 int SpawnGameObject(lua_State * L, GameObject * ptr) 308 { 309 if (ptr == NULL) return 0; 263 CHECK_TYPEID_RETNIL(TYPEID_GAMEOBJECT); 310 264 uint32 entry_id = CHECK_ULONG(L,1); 311 265 float x = CHECK_FLOAT(L, 2); … … 313 267 float z = CHECK_FLOAT(L, 4); 314 268 float o = CHECK_FLOAT(L, 5); 315 uint32 duration = luaL_checkint(L, 6); 316 float scale = (float)luaL_optnumber(L,7,1.0f); 317 if (!entry_id || !duration) 269 uint32 faction = CHECK_ULONG(L,6); 270 uint32 duration = CHECK_ULONG(L,7); 271 uint32 equip1 = luaL_optint(L, 8, 1); 272 uint32 equip2 = luaL_optint(L, 9, 1); 273 uint32 equip3 = luaL_optint(L, 10, 1); 274 uint32 phase = luaL_optint(L, 11, ptr->m_phase); 275 bool save = luaL_optint(L, 12, 0) ? true : false; 276 277 if(!entry_id) 318 278 { 319 279 lua_pushnil(L); 320 280 return 1; 321 281 } 322 323 GameObjectInfo *goi = GameObjectNameStorage.LookupEntry(entry_id); 324 if (goi == NULL) 325 { 326 dropWarning("Invalid GameObject ID specified: %u", entry_id); 327 lua_error(L); 328 return 0; 329 } 330 GameObject *pC = ptr->GetMapMgr()->CreateGameObject(entry_id); 331 if(pC == NULL) 282 CreatureProto *p = CreatureProtoStorage.LookupEntry(entry_id); 283 284 if(p == NULL) 332 285 { 333 286 lua_pushnil(L); 334 287 return 1; 335 288 } 336 pC->m_spawn=0; 337 pC->CreateFromProto(entry_id, ptr->GetMapId(), (float)x, (float)y, (float)z, (float)o); 338 pC->SetMapId(ptr->GetMapId()); 339 pC->SetInstanceID(ptr->GetInstanceID()); 340 pC->SetFloatValue(OBJECT_FIELD_SCALE_X, scale); 341 pC->Spawn(ptr->GetMapMgr()); 342 if(duration) 343 { 344 sEventMgr.AddEvent(pC, &GameObject::ExpireAndDelete, EVENT_GAMEOBJECT_UPDATE, duration, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT); 345 } 346 PUSH_GO(L,pC); 289 Creature * pCreature = ptr->GetMapMgr()->GetInterface()->SpawnCreature(entry_id,x,y,z,o,true,true,0,0,phase); 290 if(pCreature == NULL) 291 { 292 lua_pushnil(L); 293 return 1; 294 } 295 if(faction) 296 { 297 pCreature->SetFaction(faction); 298 pCreature->_setFaction(); 299 } 300 pCreature->SetInstanceID(ptr->GetInstanceID()); 301 pCreature->SetMapId(ptr->GetMapId()); 302 pCreature->SetEquippedItem(MELEE,equip1); 303 pCreature->SetEquippedItem(OFFHAND,equip2); 304 pCreature->SetEquippedItem(RANGED,equip3); 305 if (duration) 306 pCreature->Despawn(duration,0); 307 if (save) 308 pCreature->SaveToDB(); 309 PUSH_UNIT(L,pCreature); 310 return 1; 311 } 312 313 int SpawnGameObject(lua_State * L, GameObject * ptr) 314 { 315 CHECK_TYPEID_RETNIL(TYPEID_GAMEOBJECT); 316 uint32 entry_id = CHECK_ULONG(L,1); 317 float x = CHECK_FLOAT(L, 2); 318 float y = CHECK_FLOAT(L, 3); 319 float z = CHECK_FLOAT(L, 4); 320 float o = CHECK_FLOAT(L, 5); 321 uint32 duration = CHECK_ULONG(L, 6); 322 float scale = (float)(luaL_optint(L, 7, 100)/100); 323 uint32 phase = luaL_optint(L, 8, ptr->m_phase); 324 bool save = luaL_optint(L, 9, 0) ? true : false; 325 if (entry_id) 326 { 327 GameObject* pC = ptr->GetMapMgr()->GetInterface()->SpawnGameObject(entry_id,x,y,z,o,false,0,0,phase); 328 if(pC == NULL) 329 { 330 lua_pushnil(L); 331 return 1; 332 } 333 pC->SetInstanceID(ptr->GetInstanceID()); 334 pC->SetMapId(ptr->GetMapId()); 335 pC->SetFloatValue(OBJECT_FIELD_SCALE_X, scale); 336 pC->Spawn(ptr->GetMapMgr()); 337 if (duration) 338 sEventMgr.AddEvent(pC,&GameObject::ExpireAndDelete,EVENT_GAMEOBJECT_UPDATE,duration,1,EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT); 339 if (save) 340 pC->SaveToDB(); 341 PUSH_GO(L,pC); 342 } 343 else 344 lua_pushnil(L); 347 345 return 1; 348 346 } … … 350 348 int GetSpawnX(lua_State * L, GameObject * ptr) 351 349 { 352 CHECK_TYPEID_RET _INT(TYPEID_GAMEOBJECT);350 CHECK_TYPEID_RETINT(TYPEID_GAMEOBJECT); 353 351 lua_pushnumber(L,ptr->GetSpawnX()); 354 352 return 1; … … 357 355 int GetSpawnY(lua_State * L, GameObject * ptr) 358 356 { 359 CHECK_TYPEID_RET _INT(TYPEID_GAMEOBJECT);357 CHECK_TYPEID_RETINT(TYPEID_GAMEOBJECT); 360 358 lua_pushnumber(L,ptr->GetSpawnY()); 361 359 return 1; … … 364 362 int GetSpawnZ(lua_State * L, GameObject * ptr) 365 363 { 366 CHECK_TYPEID_RET _INT(TYPEID_GAMEOBJECT);364 CHECK_TYPEID_RETINT(TYPEID_GAMEOBJECT); 367 365 lua_pushnumber(L,ptr->GetSpawnZ()); 368 366 return 1; … … 371 369 int GetSpawnO(lua_State * L, GameObject * ptr) 372 370 { 373 CHECK_TYPEID_RET _INT(TYPEID_GAMEOBJECT);371 CHECK_TYPEID_RETINT(TYPEID_GAMEOBJECT); 374 372 lua_pushnumber(L,ptr->GetSpawnO()); 375 373 return 1; … … 378 376 int GetX(lua_State * L, GameObject * ptr) 379 377 { 380 CHECK_TYPEID_RET _INT(TYPEID_GAMEOBJECT);378 CHECK_TYPEID_RETINT(TYPEID_GAMEOBJECT); 381 379 lua_pushnumber(L,ptr->GetPositionX()); 382 380 return 1; … … 385 383 int GetY(lua_State * L, GameObject * ptr) 386 384 { 387 CHECK_TYPEID_RET _INT(TYPEID_GAMEOBJECT);385 CHECK_TYPEID_RETINT(TYPEID_GAMEOBJECT); 388 386 lua_pushnumber(L,ptr->GetPositionY()); 389 387 return 1; … … 392 390 int GetZ(lua_State * L, GameObject * ptr) 393 391 { 394 CHECK_TYPEID_RET _INT(TYPEID_GAMEOBJECT);if(ptr)392 CHECK_TYPEID_RETINT(TYPEID_GAMEOBJECT);if(ptr) 395 393 lua_pushnumber(L,ptr->GetPositionZ()); 396 394 return 1; … … 399 397 int GetO(lua_State * L, GameObject * ptr) 400 398 { 401 CHECK_TYPEID_RET _INT(TYPEID_GAMEOBJECT);399 CHECK_TYPEID_RETINT(TYPEID_GAMEOBJECT); 402 400 lua_pushnumber(L,ptr->GetOrientation()); 403 401 return 1; … … 406 404 int GetInRangePlayersCount(lua_State * L, GameObject * ptr) 407 405 { 408 CHECK_TYPEID_RET _INT(TYPEID_GAMEOBJECT);406 CHECK_TYPEID_RETINT(TYPEID_GAMEOBJECT); 409 407 lua_pushnumber(L,ptr->GetInRangePlayersCount()); 410 408 return 1; … … 413 411 int GetEntry(lua_State * L, GameObject * ptr) 414 412 { 415 CHECK_TYPEID_RET _INT(TYPEID_GAMEOBJECT);413 CHECK_TYPEID_RETINT(TYPEID_GAMEOBJECT); 416 414 lua_pushnumber(L,ptr->GetEntry()); 417 415 return 1; … … 600 598 CHECK_TYPEID(TYPEID_GAMEOBJECT); 601 599 uint32 sp = CHECK_ULONG(L,1); 602 if (!sp) return 0; 603 Spell * spp = new Spell(ptr,dbcSpell.LookupEntry(sp),true,NULL); 604 SpellCastTargets tar(ptr->GetGUID()); 605 spp->prepare(&tar); 606 return 0; 607 } 608 609 int FullCastSpell(lua_State * L, GameObject * ptr) 610 { 611 CHECK_TYPEID(TYPEID_GAMEOBJECT); 612 uint32 sp = CHECK_ULONG(L,1); 613 if (!sp) return 0; 614 Spell * spp = new Spell(ptr,dbcSpell.LookupEntry(sp),false,NULL); 615 SpellCastTargets tar(ptr->GetGUID()); 616 spp->prepare(&tar); 617 return 0; 618 } 619 600 if(sp) 601 { 602 Spell * tSpell = new Spell(ptr,dbcSpell.LookupEntry(sp),true,NULL); 603 SpellCastTargets tar(ptr->GetGUID()); 604 tSpell->prepare(&tar); 605 } 606 return 0; 607 } 620 608 int CastSpellOnTarget(lua_State * L, GameObject * ptr) 621 609 { … … 623 611 uint32 sp = CHECK_ULONG(L,1); 624 612 Unit * target = CHECK_UNIT(L,2); 625 if (!sp || target==NULL) return 0; 626 Spell * spp = new Spell(ptr,dbcSpell.LookupEntry(sp),true,NULL); 627 spp->m_targets.m_unitTarget = target->GetGUID(); 628 //prepare digest 629 SpellCastTargets tar(target->GetGUID()); 630 spp->m_targets = tar; 631 spp->SendSpellStart(); 632 spp->cast(false); 613 if(sp && target != NULL) 614 { 615 Spell * tSpell = new Spell(ptr,dbcSpell.LookupEntry(sp),true,NULL); 616 SpellCastTargets sp(target->GetGUID()); 617 tSpell->prepare(&sp); 618 } 633 619 return 0; 634 620 } … … 827 813 return 0; 828 814 } 829 830 int FullCastSpellOnTarget(lua_State * L, GameObject * ptr)831 {832 CHECK_TYPEID(TYPEID_GAMEOBJECT);833 uint32 sp = CHECK_ULONG(L,1);834 Unit * target = CHECK_UNIT(L,2);835 if (!sp) return 0;836 Spell * spp = new Spell(ptr,dbcSpell.LookupEntry(sp),false,NULL);837 SpellCastTargets tar(target->GetGUID());838 spp->prepare(&tar);839 return 0;840 }841 842 815 int GetGUID(lua_State * L, GameObject* ptr) 843 816 { … … 862 835 { 863 836 CHECK_TYPEID_RET(TYPEID_GAMEOBJECT); 864 lua_pushboolean(L, (ptr->IsActive() ? 1 : 0)); 865 return 1; 837 if(ptr->GetByte(GAMEOBJECT_BYTES_1,0)) 838 RET_BOOL(true); 839 RET_BOOL(false); 866 840 } 867 841 … … 869 843 { 870 844 CHECK_TYPEID_RET(TYPEID_GAMEOBJECT); 871 if (ptr->GetUInt32Value(GAMEOBJECT_DYNAMIC) == 1) 872 { 873 ptr->SetUInt32Value(GAMEOBJECT_DYNAMIC, 0); 874 } 875 else 876 { 877 ptr->SetUInt32Value(GAMEOBJECT_DYNAMIC, 1); 878 } 879 return 1; 845 if(ptr->GetByte(GAMEOBJECT_BYTES_1, 0) == 1) 846 ptr->SetByte(GAMEOBJECT_BYTES_1, 0, 0); 847 else 848 ptr->SetByte(GAMEOBJECT_BYTES_1, 0, 1); 849 ptr->SetUInt32Value(GAMEOBJECT_FLAGS, (ptr->GetUInt32Value(GAMEOBJECT_FLAGS) & ~1)); 850 RET_BOOL(true); 880 851 } 881 852 … … 960 931 return 1; 961 932 } 962 963 int SetByteValue(lua_State * L, GameObject * ptr)964 {965 if (!ptr) return 0;966 uint32 index = luaL_checkint(L,1);967 uint32 index1 = luaL_checkint(L,2);968 uint8 value = luaL_checkint(L,3);969 ptr->SetByte(index,index1,value);970 return 0;971 }972 973 int GetByteValue(lua_State * L, GameObject * ptr)974 {975 CHECK_TYPEID_RET_INT(TYPEID_GAMEOBJECT);976 uint32 index = luaL_checkint(L,1);977 uint32 index1 = luaL_checkint(L,2);978 lua_pushinteger(L,ptr->GetByte(index,index1));979 return 1;980 }981 982 933 int HasFlag(lua_State * L, GameObject * ptr) 983 934 { … … 999 950 int GetSpawnId(lua_State * L, GameObject * ptr) 1000 951 { 1001 CHECK_TYPEID_RET _INT(TYPEID_GAMEOBJECT);952 CHECK_TYPEID_RETINT(TYPEID_GAMEOBJECT); 1002 953 lua_pushnumber(L, ptr->m_spawn != NULL ? ptr->m_spawn->id : 0); 1003 954 return 1; … … 1006 957 int GetAreaId(lua_State * L, GameObject * ptr) 1007 958 { 1008 CHECK_TYPEID_RET _INT(TYPEID_GAMEOBJECT);959 CHECK_TYPEID_RETINT(TYPEID_GAMEOBJECT); 1009 960 lua_pushnumber(L, ( ptr->GetMapMgr()->GetAreaID(ptr->GetPositionX(), ptr->GetPositionY()) ) ); 1010 961 return 1; … … 1013 964 int SetPosition(lua_State * L, GameObject * ptr) 1014 965 { 1015 if (!ptr) return 0;966 CHECK_TYPEID_RET(TYPEID_GAMEOBJECT) 1016 967 uint32 NewGuid = ptr->GetMapMgr()->GenerateGameobjectGuid(); 1017 968 ptr->RemoveFromWorld(true); … … 1023 974 ptr->SetPosition(x, y, z, o); 1024 975 ptr->AddToWorld(); 1025 return 0;976 RET_BOOL(true); 1026 977 } 1027 978 1028 979 int GetObjectType(lua_State * L, GameObject * ptr) 1029 980 { 1030 if (!ptr) 1031 { 1032 lua_pushnil(L); 1033 return 1; 1034 } 1035 lua_pushstring(L, "GameObject"); 1036 return 1; 981 CHECK_TYPEID_RETNIL(TYPEID_GAMEOBJECT); 982 RET_STRING("GameObject"); 983 } 984 int ChangeScale(lua_State * L, GameObject * ptr) 985 { 986 CHECK_TYPEID_RET(TYPEID_GAMEOBJECT) 987 float nScale = CHECK_FLOAT(L,1); 988 bool updateNow = CHECK_BOOL(L,2); 989 nScale = (nScale <= 0) ? 1 : nScale; 990 ptr->SetScale(nScale); 991 if(updateNow) 992 { 993 uint32 nguid = ptr->GetMapMgr()->GenerateGameobjectGuid(); 994 ptr->RemoveFromWorld(true); 995 ptr->SetNewGuid(nguid); 996 ptr->AddToWorld(); 997 } 998 RET_BOOL(true); 999 } 1000 int GetByte(lua_State * L, GameObject * ptr) 1001 { 1002 CHECK_TYPEID_RETNIL(TYPEID_GAMEOBJECT); 1003 uint32 index = luaL_checkint(L,1); 1004 uint32 index2 = luaL_checkint(L,2); 1005 uint8 value = ptr->GetByte(index,index2); 1006 RET_INT(value); 1007 } 1008 int SetByte(lua_State * L, GameObject * ptr) 1009 { 1010 CHECK_TYPEID_RET(TYPEID_GAMEOBJECT); 1011 int index = luaL_checkint(L,1); 1012 int index2 = luaL_checkint(L,2); 1013 uint8 value = luaL_checkint(L,3); 1014 ptr->SetByte(index,index2,value); 1015 RET_BOOL(true); 1016 } 1017 int FullCastSpellOnTarget(lua_State * L, GameObject * ptr) 1018 { 1019 CHECK_TYPEID(TYPEID_GAMEOBJECT); 1020 uint32 sp = CHECK_ULONG(L,1); 1021 Unit * target = CHECK_UNIT(L,2); 1022 if(sp && target != NULL) 1023 { 1024 Spell * tSpell = new Spell(ptr,dbcSpell.LookupEntry(sp),false,NULL); 1025 SpellCastTargets sct(target->GetGUID()); 1026 tSpell->prepare(&sct); 1027 } 1028 return 0; 1029 } 1030 int FullCastSpell(lua_State * L, GameObject * ptr) 1031 { 1032 CHECK_TYPEID(TYPEID_GAMEOBJECT); 1033 uint32 sp = CHECK_ULONG(L,1); 1034 if(sp) 1035 { 1036 Spell * tSpell = new Spell(ptr,dbcSpell.LookupEntry(sp),false,NULL); 1037 SpellCastTargets sct(ptr->GetGUID()); 1038 tSpell->prepare(&sct); 1039 } 1040 return 0; 1041 } 1042 int CustomAnimate(lua_State * L, GameObject * ptr) 1043 { 1044 uint32 aindex = CHECK_ULONG(L,1); 1045 if(aindex < 2 && ptr != NULL) 1046 { 1047 WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM,12); 1048 data << ptr->GetGUID(); 1049 data << aindex; 1050 ptr->SendMessageToSet(&data,false); 1051 RET_BOOL(true); 1052 } 1053 RET_BOOL(false); 1037 1054 } 1038 1055 } -
Trunk/src/LuaEngine/LUAEngine.cpp
r1135 r1144 949 949 if(ref == LUA_REFNIL || ref == LUA_NOREF) 950 950 return luaL_error(L,"Error in SuspendLuaThread! Failed to create a valid reference."); 951 TimedEvent * evt = TimedEvent::Allocate(thread,new CallbackP 2<LuaEngine,lua_State*,int>(&g_luaMgr,&LuaEngine::ResumeLuaThread,thread,ref),0,waitime,1);951 TimedEvent * evt = TimedEvent::Allocate(thread,new CallbackP1<LuaEngine,int>(&g_luaMgr,&LuaEngine::ResumeLuaThread,ref),0,waitime,1); 952 952 sWorld.event_AddEvent(evt); 953 953 lua_remove(L,1); // remove thread object … … 955 955 //All that remains now are the extra arguments passed to this function. 956 956 lua_xmove(L,thread,lua_gettop(L)); 957 g_luaMgr.get PendingThreadSet().insert(thread);957 g_luaMgr.getThreadRefs().insert(ref); 958 958 return lua_yield(thread,lua_gettop(L)); 959 959 } … … 1541 1541 public: 1542 1542 LuaCreature(Creature* creature) : CreatureAIScript(creature) {}; 1543 ~LuaCreature() {}; 1543 ~LuaCreature() 1544 { 1545 typedef std::multimap<uint32,LuaCreature*> CMAP; 1546 CMAP & cMap = sLuaMgr.getLuCreatureMap(); 1547 CMAP::iterator itr = cMap.find(_unit->GetEntry()); 1548 CMAP::iterator itend = cMap.upper_bound(_unit->GetEntry()); 1549 CMAP::iterator it; 1550 for(;itr != cMap.end() && itr != itend;) 1551 { 1552 it = itr++; 1553 if(it->second != NULL && it->second == this) 1554 cMap.erase(it); 1555 } 1556 } 1544 1557 ARCEMU_INLINE void SetUnit(Creature * ncrc) { _unit = ncrc; } 1545 1558 void OnCombatStart(Unit* mTarget) … … 1933 1946 sLuaMgr.ExecuteCall(args); 1934 1947 RELEASE_LOCK 1935 }1936 1937 void Destroy()1938 {1939 typedef std::multimap<uint32,LuaCreature*> CMAP;1940 CMAP & cMap = sLuaMgr.getLuCreatureMap();1941 CMAP::iterator itr = cMap.find(_unit->GetEntry());1942 CMAP::iterator itend = cMap.upper_bound(_unit->GetEntry());1943 CMAP::iterator it;1944 for(;itr != cMap.end() && itr != itend;)1945 {1946 it = itr++;1947 if(it->second != NULL && it->second == this)1948 cMap.erase(it);1949 }1950 delete this;1951 1948 } 1952 1949 LuaUnitBinding * m_binding; … … 2388 2385 CRCMAP::iterator itr = cMap.find(id); 2389 2386 CRCMAP::iterator itend = cMap.upper_bound(id); 2390 for(; itr != itend; ++itr)2387 for(; itr != cMap.end() && itr != itend; ++itr) 2391 2388 { 2392 2389 //grab the 1st and initalize … … 2425 2422 GMAP::iterator itr = gMap.find(id); 2426 2423 GMAP::iterator itend = gMap.upper_bound(id); 2427 for(; itr != itend; ++itr)2424 for(; itr != gMap.end() && itr != itend; ++itr) 2428 2425 { 2429 2426 if(itr->second != NULL && itr->second->getGO() != NULL && itr->second->getGO()->GetGUID() == guid) … … 2798 2795 void LuaEngine::Unload() 2799 2796 { 2800 lua_close(lu);// clean up the engine of any existing defined variables2797 // clean up the engine of any existing defined variables 2801 2798 { 2802 2799 UnitBindingMap::iterator itr = this->m_unitBinding.begin(); … … 2886 2883 } 2887 2884 } 2888 2889 m_pendingThreads.clear(); 2885 set<int>::iterator itr = m_pendingThreads.begin(); 2886 for(; itr != m_pendingThreads.end(); ++itr) 2887 { 2888 lua_unref(lu,(*itr)); 2889 } 2890 m_pendingThreads.erase(m_pendingThreads.begin(),m_pendingThreads.end()); 2891 2892 lua_close(lu); 2890 2893 } 2891 2894 void LuaEngine::Restart() … … 3065 3068 } 3066 3069 3067 void LuaEngine::ResumeLuaThread( lua_State * thread,int ref) {3070 void LuaEngine::ResumeLuaThread(int ref) { 3068 3071 getcoLock().Acquire(); 3069 3072 lua_State * expectedThread = NULL; 3070 lua_State * foundthread = NULL;3071 3073 lua_rawgeti(lu,LUA_REGISTRYINDEX,ref); 3072 3074 if(lua_isthread(lu,-1) ) 3073 3075 expectedThread = lua_tothread(lu,-1); 3074 foundthread = getPendingThread(thread); 3075 if(expectedThread != NULL && foundthread != NULL) 3076 if(expectedThread != NULL) 3076 3077 { 3077 3078 //push ourself on the stack 3078 lua_pushthread( foundthread);3079 lua_pushthread(expectedThread); 3079 3080 //move the thread to the main lu state(and pop it off) 3080 lua_xmove( foundthread,lu,1);3081 lua_xmove(expectedThread,lu,1); 3081 3082 if(lua_rawequal(lu,-1,-2) ) 3082 3083 { … … 3099 3100 #define CHECK_TYPEID(expected_type) if(!ptr || !ptr->IsInWorld() || ptr->GetTypeId() != expected_type) { return 0; } 3100 3101 #define CHECK_TYPEID_RET(expected_type) if(!ptr || !ptr->IsInWorld() || ptr->GetTypeId() != expected_type) { lua_pushboolean(L,0); return 1; } 3101 #define CHECK_TYPEID_RET_INT(expected_type) if(!ptr || !ptr->IsInWorld() || ptr->GetTypeId() != expected_type) { lua_pushinteger(L,0); return 1; } 3102 #define CHECK_TYPEID_RET_NIL(expected_type) if(!ptr || !ptr->isInWorld() || ptr->GetTypeId() != expected_type) { lua_pushnil(L); return 1; } 3102 #define CHECK_TYPEID_RETINT(expected_type) if(!ptr || !ptr->IsInWorld() || ptr->GetTypeId() != expected_type) { lua_pushinteger(L,0); return 1; } 3103 #define CHECK_TYPEID_RETNIL(expected_type) if(!ptr || !ptr->IsInWorld() || ptr->GetTypeId() != expected_type) { lua_pushnil(L); return 1; } (void*)0 3104 #define RET_NIL { lua_pushnil(L); return 1; } (void*)0 3105 #define RET_BOOL(exp) { (exp) ? lua_pushboolean(L,1) : lua_pushboolean(L,0); return 1; } (void*)0 3106 #define RET_STRING(str) { lua_pushstring(L,(str)); return 1; } (void*)0 3107 #define RET_NUMBER(number) { lua_pushnumber(L,(number)); return 1; } (void*)0 3108 #define RET_INT(integer) { lua_pushinteger(L,(integer)); return 1; } (void*)0 3103 3109 3104 3110 // Simplicity macros. -
Trunk/src/LuaEngine/LUAEngine.h
r1122 r1144 221 221 typedef HM_NAMESPACE::hash_map<uint32, LuaItemGossipBinding> GossipItemScriptsBindingMap; 222 222 typedef HM_NAMESPACE::hash_map<uint32, LuaGOGossipBinding> GossipGOScriptsBindingMap; 223 std::set< lua_State *> m_pendingThreads;223 std::set<int> m_pendingThreads; 224 224 225 225 //maps to creature, & go script interfaces … … 253 253 254 254 void RegisterEvent(uint8 regtype, uint32 id, uint32 evt, const char * func); 255 void ResumeLuaThread( lua_State *,int);255 void ResumeLuaThread(int); 256 256 bool BeginCall(const char * func); 257 257 void HyperCallFunction(const char * FuncName, int ref); … … 375 375 return (itr == m_qAIScripts.end()) ? NULL: itr->second; 376 376 } 377 lua_State*getPendingThread(lua_State * threadtosearch) {377 /*int getPendingThread(lua_State * threadtosearch) { 378 378 set<lua_State*>::iterator itr = m_pendingThreads.find(threadtosearch); 379 379 return (itr == m_pendingThreads.end() )? NULL : (*itr); 380 } 380 }*/ 381 381 LuaGossip * getUnitGossipInterface(uint32 id) 382 382 { … … 400 400 ARCEMU_INLINE HM_NAMESPACE::hash_map<uint32, LuaGossip*> & getItemGossipInterfaceMap() { return m_itemgAIScripts; } 401 401 ARCEMU_INLINE HM_NAMESPACE::hash_map<uint32, LuaGossip*> & getGameObjectGossipInterfaceMap() { return m_gogAIScripts; } 402 ARCEMU_INLINE set< lua_State * > & getPendingThreadSet() { return m_pendingThreads; }402 ARCEMU_INLINE set<int> & getThreadRefs() { return m_pendingThreads; } 403 403 404 404 struct _ENGINEHOOKINFO { -
Trunk/src/LuaEngine/UnitFunctions.h
r1142 r1144 445 445 int CastSpell(lua_State * L, Unit * ptr) 446 446 { 447 //CHECK_TYPEID(TYPEID_UNIT || TYPEID_PLAYER);448 447 uint32 sp = CHECK_ULONG(L,1); 449 448 if (sp && ptr) … … 454 453 int FullCastSpell(lua_State * L, Unit * ptr) 455 454 { 456 //CHECK_TYPEID(TYPEID_UNIT || TYPEID_PLAYER);457 455 uint32 sp = CHECK_ULONG(L,1); 458 456 if (sp && ptr) … … 460 458 return 0; 461 459 } 460 int FullCastSpellOnTarget(lua_State * L, Unit * ptr) 461 { 462 if(ptr != NULL) 463 { 464 uint32 sp = CHECK_ULONG(L,1); 465 Unit * target = CHECK_UNIT(L,2); 466 if(sp && target != NULL) 467 ptr->CastSpell(target->GetGUID(),sp,false); 468 } 469 return 0; 470 } 462 471 int CastSpellOnTarget(lua_State * L, Unit * ptr) 463 472 { … … 465 474 Unit * target = CHECK_UNIT(L,2); 466 475 if(ptr != NULL && sp && target != NULL) 467 { 468 Spell * spp = new Spell(ptr,dbcSpell.LookupEntry(sp),true,NULL); 469 spp->m_targets.m_unitTarget = target->GetGUID(); 470 //prepare digest 471 SpellCastTargets tar(target->GetGUID()); 472 spp->m_targets = tar; 473 spp->SendSpellStart(); 474 spp->cast(false); 475 } 476 return 0; 477 } 478 479 int FullCastSpellOnTarget(lua_State * L, Unit * ptr) 480 { 481 //CHECK_TYPEID(TYPEID_UNIT || TYPEID_PLAYER); 482 uint32 sp = CHECK_ULONG(L,1); 483 Unit * target = CHECK_UNIT(L, 2); 484 485 if (!sp || !target || !ptr) 486 return 0; 487 ptr->CastSpell(target,dbcSpell.LookupEntry(sp),false); 476 ptr->CastSpell(target,sp,true); 488 477 return 0; 489 478 } … … 504 493 bool save = luaL_optint(L, 12, 0) ? true : false; 505 494 506 if(!entry_id || !faction)495 if(!entry_id) 507 496 { 508 497 lua_pushnil(L); … … 521 510 return 1; 522 511 } 523 pCreature->SetFaction(faction); 524 pCreature->_setFaction(); 512 if(faction) 513 { 514 pCreature->SetFaction(faction); 515 pCreature->_setFaction(); 516 } 525 517 pCreature->SetInstanceID(ptr->GetInstanceID()); 526 518 pCreature->SetMapId(ptr->GetMapId()); … … 528 520 pCreature->SetEquippedItem(OFFHAND,equip2); 529 521 pCreature->SetEquippedItem(RANGED,equip3); 522 pCreature->m_noRespawn = true; 530 523 if (duration) 531 524 pCreature->Despawn(duration,0); … … 568 561 lua_pushnil(L); 569 562 return 1; 570 571 572 563 } 573 564 … … 622 613 int IsInCombat(lua_State * L, Unit * ptr) 623 614 { 624 if (!ptr)625 return 0;615 if(ptr == NULL || !ptr->IsInWorld() ) 616 RET_NIL; 626 617 if(ptr->CombatStatus.IsInCombat()) 627 618 lua_pushboolean(L, 1); … … 633 624 int SetScale(lua_State * L, Unit * ptr) 634 625 { 635 //CHECK_TYPEID(TYPEID_UNIT);636 626 float scale = CHECK_FLOAT(L,1); 637 627 if (scale && ptr) 638 628 ptr->SetFloatValue(OBJECT_FIELD_SCALE_X,(float)scale); 639 return 0; 629 else 630 RET_BOOL(false); 631 RET_BOOL(true); 640 632 } 641 633 642 634 int SetModel(lua_State * L, Unit * ptr) 643 635 { 644 int modelid = luaL_checkint(L,1);645 if(ptr != NULL) 646 {647 ptr->SetDisplayId(modelid);648 }649 return 0;636 uint32 model = CHECK_ULONG(L,1); 637 if(ptr != NULL) 638 ptr->SetDisplayId(model); 639 else 640 RET_BOOL(false); 641 RET_BOOL(true); 650 642 } 651 643 … … 658 650 return 0; 659 651 } 660 661 int SetCombatCapable(lua_State * L, Unit * ptr)662 {663 CHECK_TYPEID(TYPEID_UNIT);664 bool enabled = CHECK_BOOL(L,1);665 ptr->GetAIInterface()->disable_combat = enabled;666 return 0;667 }668 669 int SetCombatMeleeCapable(lua_State * L, Unit * ptr)670 {671 CHECK_TYPEID(TYPEID_UNIT);672 bool enabled = CHECK_BOOL(L,1);673 ptr->GetAIInterface()->disable_melee = enabled;674 return 0;675 }676 677 int SetCombatRangedCapable(lua_State * L, Unit * ptr)678 {679 CHECK_TYPEID(TYPEID_UNIT);680 bool enabled = CHECK_BOOL(L,1);681 ptr->GetAIInterface()->disable_ranged = enabled;682 return 0;683 }684 685 int SetCombatSpellCapable(lua_State * L, Unit * ptr)686 {687 CHECK_TYPEID(TYPEID_UNIT);688 bool enabled = CHECK_BOOL(L,1);689 ptr->GetAIInterface()->disable_spell = enabled;690 return 0;691 }692 693 int SetCombatTargetingCapable(lua_State * L, Unit * ptr)694 {695 CHECK_TYPEID(TYPEID_UNIT);696 bool enabled = CHECK_BOOL(L,1);697 ptr->GetAIInterface()->disable_targeting = enabled;698 return 0;699 }700 701 652 int SetMount(lua_State * L, Unit * ptr) 702 653 { … … 1088 1039 uint32 count = 0; 1089 1040 Unit* mt = ptr->GetAIInterface()->GetMostHated(); 1090 if ( !mt->IsPlayer())1041 if (mt == NULL || !mt->IsPlayer()) 1091 1042 return 0; 1092 1043 … … 1498 1449 int GetItemCount(lua_State * L, Unit * ptr) 1499 1450 { 1500 CHECK_TYPEID_RET _INT(TYPEID_PLAYER);1451 CHECK_TYPEID_RETINT(TYPEID_PLAYER); 1501 1452 int itemid = luaL_checkint(L,1); 1502 1453 lua_pushinteger(L, TO_PLAYER(ptr)->GetItemInterface()->GetItemCount(itemid,false)); … … 1519 1470 int GetMainTank(lua_State * L, Unit * ptr) 1520 1471 { 1521 CHECK_TYPEID_RET _INT(TYPEID_UNIT);1472 CHECK_TYPEID_RETINT(TYPEID_UNIT); 1522 1473 Unit* ret = ptr->GetAIInterface()->GetMostHated(); 1523 1474 if (!ret) … … 1530 1481 int GetAddTank(lua_State * L, Unit * ptr) 1531 1482 { 1532 CHECK_TYPEID_RET _INT(TYPEID_UNIT);1483 CHECK_TYPEID_RETINT(TYPEID_UNIT); 1533 1484 Unit* ret = ptr->GetAIInterface()->GetSecondHated(); 1534 1485 if(ret==NULL) … … 1541 1492 int ClearThreatList(lua_State * L, Unit * ptr) 1542 1493 { 1543 CHECK_TYPEID_RET _INT(TYPEID_UNIT);1494 CHECK_TYPEID_RETINT(TYPEID_UNIT); 1544 1495 ptr->ClearHateList(); 1545 1496 return 0; … … 1895 1846 int WipeHateList(lua_State * L, Unit * ptr) 1896 1847 { 1897 CHECK_TYPEID_RET _INT(TYPEID_UNIT);1848 CHECK_TYPEID_RETINT(TYPEID_UNIT); 1898 1849 ptr->WipeHateList(); 1899 1850 return 0; … … 1902 1853 int WipeTargetList(lua_State * L, Unit * ptr) 1903 1854 { 1904 CHECK_TYPEID_RET _INT(TYPEID_UNIT);1855 CHECK_TYPEID_RETINT(TYPEID_UNIT); 1905 1856 ptr->GetAIInterface()->WipeTargetList(); 1906 1857 return 0; … … 1909 1860 int WipeCurrentTarget(lua_State * L, Unit * ptr) 1910 1861 { 1911 CHECK_TYPEID_RET _INT(TYPEID_UNIT);1862 CHECK_TYPEID_RETINT(TYPEID_UNIT); 1912 1863 ptr->GetAIInterface()->WipeCurrentTarget(); 1913 1864 return 0; … … 1967 1918 int ClearHateList(lua_State * L, Unit * ptr) 1968 1919 { 1969 CHECK_TYPEID_RET _INT(TYPEID_UNIT);1920 CHECK_TYPEID_RETINT(TYPEID_UNIT); 1970 1921 ptr->ClearHateList(); 1971 1922 return 0; … … 4083 4034 int GetSelection(lua_State * L, Unit * ptr) 4084 4035 { 4085 CHECK_TYPEID (TYPEID_PLAYER);4036 CHECK_TYPEID_RETNIL(TYPEID_PLAYER); 4086 4037 Player * plr = TO_PLAYER(ptr); 4087 4038 Unit * selection = plr->GetMapMgr()->GetUnit(plr->GetSelection()); … … 4092 4043 return 1; 4093 4044 } 4045 int GetSelectedGO(lua_State * L, Unit * ptr) 4046 { 4047 CHECK_TYPEID_RETNIL(TYPEID_PLAYER); 4048 Player * plr = TO_PLAYER(ptr); 4049 PUSH_GO(L,plr->GetSelectedGo()); 4050 return 1; 4051 } 4094 4052 4095 4053 int RepairAllPlayerItems(lua_State * L, Unit * ptr) 4096 4054 { 4097 CHECK_TYPEID (TYPEID_PLAYER);4055 CHECK_TYPEID_RET(TYPEID_PLAYER); 4098 4056 Player * plr = TO_PLAYER(ptr); 4099 4057 Item * pItem = NULL; … … 5907 5865 return 1; 5908 5866 } 5867 int GetCurrentWaypoint(lua_State * L, Unit * ptr) 5868 { 5869 CHECK_TYPEID_RETNIL(TYPEID_UNIT); 5870 RET_NUMBER(ptr->GetAIInterface()->getCurrentWaypoint()); 5871 } 5872 int DisableMelee(lua_State * L, Unit * ptr) 5873 { 5874 CHECK_TYPEID_RET(TYPEID_UNIT) 5875 bool disable = CHECK_BOOL(L,1); 5876 TO_CREATURE(ptr)->GetAIInterface()->disable_melee = disable; 5877 RET_BOOL(true); 5878 } 5879 int DisableSpells(lua_State * L, Unit * ptr) 5880 { 5881 CHECK_TYPEID_RET(TYPEID_UNIT) 5882 bool disable = CHECK_BOOL(L,1); 5883 TO_CREATURE(ptr)->GetAIInterface()->disable_spell = disable; 5884 RET_BOOL(true); 5885 } 5886 int DisableRanged(lua_State * L, Unit * ptr) 5887 { 5888 CHECK_TYPEID_RET(TYPEID_UNIT) 5889 bool disable = CHECK_BOOL(L,1); 5890 TO_CREATURE(ptr)->GetAIInterface()->disable_ranged = disable; 5891 RET_BOOL(true); 5892 } 5893 int DisableCombat(lua_State * L, Unit * ptr) 5894 { 5895 CHECK_TYPEID_RET(TYPEID_UNIT) 5896 bool disable = CHECK_BOOL(L,1); 5897 TO_CREATURE(ptr)->GetAIInterface()->disable_combat = disable; 5898 RET_BOOL(true); 5899 } 5900 int DisableTargeting(lua_State * L, Unit * ptr) 5901 { 5902 CHECK_TYPEID_RET(TYPEID_UNIT) 5903 bool disable = CHECK_BOOL(L,1); 5904 TO_CREATURE(ptr)->GetAIInterface()->disable_targeting = disable; 5905 RET_BOOL(true); 5906 } 5907 int IsInGroup(lua_State * L, Unit * ptr) 5908 { 5909 CHECK_TYPEID_RET(TYPEID_PLAYER) 5910 if(TO_PLAYER(ptr)->InGroup() ) 5911 RET_BOOL(true); 5912 RET_BOOL(false); 5913 } 5909 5914 } 5910 5915 #endif
![(please configure the [header_logo] section in trac.ini)](/trac/arcscripts/chrome/site/your_project_logo.png)