Changeset 1212

Show
Ignore:
Timestamp:
03/07/2010 04:04:26 PM (6 months ago)
Author:
Paroxysm
Message:

FIXED : Ok now i've really fixed LCF:RegisterLuaEvent issues. xD
ADDED : Some more work on auchindoun,

  • Unit:GetSecondHated() method
Location:
Trunk
Files:
4 added
7 modified

Legend:

Unmodified
Added
Removed
  • Trunk/lua/0Misc/0LCF_Includes/LCF_Creature.lua

    r1208 r1212  
    5252        end 
    5353end 
     54function CREATURE:SetChannelTarget(target) 
     55        local guid = nil 
     56        if(target) then  
     57                guid = target:GetGUID() 
     58        end 
     59        self:SetUInt64Value(LCF.UNIT_FIELD_CHANNEL_OBJECT,guid) 
     60end 
    5461function CREATURE:GetChannelTarget() 
    5562        local guid = self:GetUInt64Value(LCF.UNIT_FIELD_CHANNEL_OBJECT) 
    5663        if(guid) then 
    57                 return self:GetUnitByGUID(guid) 
     64                return self:GetObject(guid) 
    5865        end 
    5966        return nil 
     
    7986        self:SendChatMessage(LCF.CHAT_MSG_MONSTER_WHISPER,LCF.LANG_UNIVERSAL,msg) 
    8087end 
     88function CREATURE:BossRaidEmote(msg) 
     89        self:SendChatMessage(LCF.CHAT_MSG_RAID_BOSS_EMOTE,LCF.LANG_UNIVERSAL,msg) 
     90end 
    8191function CREATURE:MoveToUnit(target) 
    8292        local x,y,z = target:GetLocation() 
     
    97107end 
    98108function CREATURE:SetCreator(creator) 
    99         self:SetUInt64Value(LCF.UNIT_FIELD_CREATEDBY,creator:GetGUID()) 
     109        local guid = nil 
     110        if(creator) then 
     111                guid = creator:GetGUID() 
     112        end 
     113        self:SetUInt64Value(LCF.UNIT_FIELD_CREATEDBY,guid) 
     114        self:SetUInt64Value(LCF.UNIT_FIELD_SUMMONEDBY,guid) 
    100115end 
    101116function CREATURE:GetCreator() 
  • Trunk/lua/0Misc/0LCF_Includes/LCF_Extra.lua

    r1208 r1212  
    3737end 
    3838function LCF:HandleOnAreaTrigger(event,player,area_trig) 
     39        player:SendAreaTriggerMessage("[AREA TRIGGER] "..area_trig) 
    3940        local key = "area "..tostring(area_trig) 
    4041        local struct = self.areatrigger_hooks[key] 
     
    112113        assert(type(arg) == "table","Internal error, arg is not a table.") 
    113114        if(delay <= 0) then error("Invalid argument #2, delay must be greater than 0.") end 
    114         local struct = {evt_typ,{func,delay,repeats,repeats,arg} } 
     115        local struct = {evt_typ,{func,delay,delay,repeats,arg} } 
    115116        table.insert(self.call_backs,struct) 
    116117end 
  • Trunk/lua/0Misc/0LCF_Includes/LCF_Gameobject.lua

    r1208 r1212  
    6666        self:SetUInt64Value(LCF.OBJECT_FIELD_CREATED_BY,guid) 
    6767end 
    68 function GAMEOBJECT:GetCreator() 
    69         local guid = self:GetUInt64Value(LCF.OBJECT_FIELD_CREATED_BY) 
    70         return self:GetObject(guid) 
    71 end 
    7268function GAMEOBJECT:GetLocalCreature(entry) 
    7369        local x,y,z = self:GetLocation() 
  • Trunk/lua/AUCHINDOUN/MANA_TOMBS/Pandemonius.script

    r1208 r1212  
    5757         
    5858        if(ref.dark_shell <= 0) then 
    59                 unit:MonsterEmote(unit:GetName().." casts dark shell!") 
     59                unit:BossRaidEmote(unit:GetName().." casts dark shell!") 
    6060                if(ref.isHeroic) then 
    6161                        unit:FullCastSpell(38759) 
  • Trunk/src/LuaEngine/FunctionTables.h

    r1207 r1212  
    525525        { "GetPlayerMovementFlags", &luaUnit::GetPlayerMovementFlags}, 
    526526        { "GetObject", &luaUnit::GetObject }, 
     527        { "GetSecondHated", &luaUnit::GetSecondHated }, 
    527528        { NULL, NULL }, 
    528529}; 
  • Trunk/src/LuaEngine/GlobalFunctions.h

    r1205 r1212  
    506506                if(top > 1) 
    507507                { 
    508                         for(int i = 2; i < top; ++i) 
     508                        for(int i = 2; i <= top; ++i) 
    509509                        { 
    510510                                if(lua_isnumber(L,i) ) 
     
    520520                if(top > 1) 
    521521                { 
    522                         for(int i = 2; i < top; ++i) 
     522                        for(int i = 2; i <= top; ++i) 
    523523                        { 
    524524                                if(lua_isnumber(L,i) ) 
     
    534534                if(top > 1) 
    535535                { 
    536                         for(int i = 2; i < top; ++i) 
     536                        for(int i = 2; i <= top; ++i) 
    537537                        { 
    538538                                if(lua_isnumber(L,i) ) 
  • Trunk/src/LuaEngine/UnitFunctions.h

    r1207 r1212  
    58665866                return 1; 
    58675867        } 
     5868        int GetSecondHated(lua_State * L, Unit * ptr) 
     5869        { 
     5870                TEST_UNIT(); 
     5871                PUSH_UNIT(L,ptr->GetAIInterface()->GetSecondHated()); 
     5872                return 1; 
     5873        } 
    58685874} 
    58695875#endif