mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 20:14:54 +02:00
Multi-protocol
Lots of chagnes to add multi protocol flexibility, not really completed yet, still have to rework text messages opcodes and other stuff, so this still a working in progress feature * Rework dat reader, the dat reader can now * dinamically detect dat version * Split game into gamelib and game_interface * Lots of other minor changes
This commit is contained in:
54
modules/gamelib/player.lua
Normal file
54
modules/gamelib/player.lua
Normal file
@@ -0,0 +1,54 @@
|
||||
-- @docclass Player
|
||||
|
||||
InventorySlotHead = 1
|
||||
InventorySlotNeck = 2
|
||||
InventorySlotBack = 3
|
||||
InventorySlotBody = 4
|
||||
InventorySlotRight = 5
|
||||
InventorySlotLeft = 6
|
||||
InventorySlotLeg = 7
|
||||
InventorySlotFeet = 8
|
||||
InventorySlotFinger = 9
|
||||
InventorySlotAmmo = 10
|
||||
|
||||
InventorySlotFirst = 1
|
||||
InventorySlotLast = 10
|
||||
|
||||
function Player:isPartyLeader()
|
||||
local shield = self:getShield()
|
||||
return (shield == ShieldWhiteYellow or
|
||||
shield == ShieldYellow or
|
||||
shield == ShieldYellowSharedExp or
|
||||
shield == ShieldYellowNoSharedExpBlink or
|
||||
shield == ShieldYellowNoSharedExp)
|
||||
end
|
||||
|
||||
function Player:isPartyMember()
|
||||
local shield = self:getShield()
|
||||
return (shield == ShieldWhiteYellow or
|
||||
shield == ShieldYellow or
|
||||
shield == ShieldYellowSharedExp or
|
||||
shield == ShieldYellowNoSharedExpBlink or
|
||||
shield == ShieldYellowNoSharedExp or
|
||||
shield == ShieldBlueSharedExp or
|
||||
shield == ShieldBlueNoSharedExpBlink or
|
||||
shield == ShieldBlueNoSharedExp or
|
||||
shield == ShieldBlue)
|
||||
end
|
||||
|
||||
function Player:isPartySharedExperienceActive()
|
||||
local shield = self:getShield()
|
||||
return (shield == ShieldYellowSharedExp or
|
||||
shield == ShieldYellowNoSharedExpBlink or
|
||||
shield == ShieldYellowNoSharedExp or
|
||||
shield == ShieldBlueSharedExp or
|
||||
shield == ShieldBlueNoSharedExpBlink or
|
||||
shield == ShieldBlueNoSharedExp)
|
||||
end
|
||||
|
||||
function Player:hasVip(creatureName)
|
||||
for id, vip in pairs(g_game.getVips()) do
|
||||
if (vip[1] == creatureName) then return true end
|
||||
end
|
||||
return false
|
||||
end
|
Reference in New Issue
Block a user