Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------- LOCALS --------------------
- local logondb = "account"
- local membertype_tablename = "member_type"
- -------------------- EN OF LOCALS --------------
- --************* DO NOT EDIT BELLOW ***********--
- local Time = {}
- function EnterCombatTime(event, pPlayer, pTarget) -- this is when the player enters in combat
- local Pstr, Tstr = tostring(pPlayer), tostring(pTarget)
- if(not Time[Pstr]) then
- Time[Pstr] = {}
- end
- if(not Time[Pstr][Tstr]) then
- Time[Pstr][Tstr] = GetGameTime()
- end
- end
- RegisterServerHook(9, EnterCombatTime)
- function Pve_Boss(event, pPlayer, pUnit)
- if pUnit:IsPlayer() then
- return
- end
- local CheckingRank = WorldDBQuery("SELECT `boss` FROM `creature_proto` WHERE `entry` = '"..pUnit:GetEntry().."';")
- if(not CheckingRank) then
- return
- end
- local BossRank = CheckingRank:GetColumn(0):GetLong()
- if (pPlayer:IsInGroup()) then
- local grptype = pPlayer:GetGroupType()
- if (grptype == 2) then
- method = "Raid"
- else
- method = "Party"
- end
- end
- if (pPlayer:IsGm() == true) then
- gmicon = " |Tinterface\\ChatFrame\\UI-ChatIcon-Blizz.blp:12:24:1:-1|t"
- else
- gmicon = ""
- end
- local group = "Method: Alone!"
- if (pPlayer:IsInGroup() == true) then
- local grpnr = pPlayer:GetGroupPlayers()
- for k, v in pairs(grpnr) do
- group = ""..method.." method, "..k.." players assisted"
- end
- end
- local MemberType = WorldDBQuery("SELECT `"..membertype_tablename.."` FROM "..logondb..".accounts WHERE `login`='"..pPlayer:GetAccountName().."';");
- if(not MemberType) then
- return
- end
- local Member = MemberType:GetColumn(0):GetLong()
- local vip = "Player"
- if (Member == 1) then
- vip = "Vip 1"
- elseif (Member == 2) then
- vip = "Vip 2"
- elseif (Member == 3) then
- vip = "Vip 3"
- elseif (Member == 4) then
- vip = "Vip 4"
- elseif (Member == 5) then
- vip = "Vip 5"
- elseif (Member == 6) then
- vip = "Vip 6"
- end
- local Pstr, Tstr = tostring(pPlayer), tostring(pUnit)
- if(Time[str]) then
- local Time2nd = GetGameTime()-Time[str]
- if (BossRank == 0) or pUnit:IsPlayer() then
- -- nothing to show in world
- else
- SendWorldMessage("[PVE]"..gmicon.." "..vip.." |cffFFFFFF|Hplayer:"..pPlayer:GetName().."|h["..pPlayer:GetName().."]|h|r killed ["..pUnit:GetName().."] "..group.." "..Time2nd.."", 2)
- Time[Pstr][Tstr] = nil
- end
- end
- end
- RegisterServerHook(28, "Pve_Boss")
- function EraseVariables(event, pPlayer)
- Time[tostring(pPlayer)] = nil
- end
- RegisterServerHook(4, EraseVariables) -- change map
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement