<event type="death" name="PlayerDeathVocation" event="script" value="resetdeathvocation.lua"/>
function onDeath(cid, corpse, killer)
if isPlayer(cid) then
setPlayerVocation(cid,0)
doPlayerPopupFYI(cid, "You lost your vocation.")
end
return true
end
Hi.. try this..
In creaturescript...
Code:<event type="death" name="PlayerDeathVocation" event="script" value="resetdeathvocation.lua"/>
Create a lua file with..
Code:function onDeath(cid, corpse, killer) if isPlayer(cid) then setPlayerVocation(cid,0) doPlayerPopupFYI(cid, "You lost your vocation.") end return true end
Sorry for poor english.. Enjoy.
Have same problem. Anyone solved this?
Is the player saved at all?
Ex EQ, exp, etc etc
[Warning - Vocations::getVocation] Vocation 4294967295 not found.
Vocation* Vocations::getVocation(uint32_t vocId)
{
VocationsMap::iterator it = vocationsMap.find(vocId);
if(it != vocationsMap.end())
return it->second;
std::clog << "[Warning - Vocations::getVocation] Vocation " << vocId << " not found." << std::endl;
return &Vocations::defVoc;
}
Yeah, all is saved. Just vocation in db is set to 0. And 'promotion' field in db stays at '1'.
I just got this message in console:
Code:[Warning - Vocations::getVocation] Vocation 4294967295 not found.
So, this function prints it, and then when not found ::defVoc is returned, which is (I assume) 0.
Code:Vocation* Vocations::getVocation(uint32_t vocId) { VocationsMap::iterator it = vocationsMap.find(vocId); if(it != vocationsMap.end()) return it->second; std::clog << "[Warning - Vocations::getVocation] Vocation " << vocId << " not found." << std::endl; return &Vocations::defVoc; }
It happens on login.
I'll investigate this further.