Helliot1
Owner of Empire Online
- Joined
- Jul 26, 2017
- Messages
- 315
- Solutions
- 1
- Reaction score
- 57
Hello guys, I'm trying to use extended opcode and I have some questions.
I need to get the player vocation every time that I log in so I put this inside my "creaturescripts/login.lua". But how can I read the extended opcode in my OTC module? Because I have a spell module for each vocation and I want it to open according to each vocation.
I need to get the player vocation every time that I log in so I put this inside my "creaturescripts/login.lua". But how can I read the extended opcode in my OTC module? Because I have a spell module for each vocation and I want it to open according to each vocation.
Lua:
-- Vocation
local targetVocation = player:getVocation():getId()
if not targetVocation then
return true
end
if targetVocation == 1 then
player:sendExtendedOpcode(12, 1)
player:say("I'm a warrior!", TALKTYPE_MONSTER_SAY)
elseif targetVocation == 2 then
player:sendExtendedOpcode(12, 2)
player:say("I'm a ranger!", TALKTYPE_MONSTER_SAY)
elseif targetVocation == 3 then
player:sendExtendedOpcode(12, 3)
player:say("I'm a mage!", TALKTYPE_MONSTER_SAY)
end
Last edited: