Noupz
New Member
- Joined
- Jul 13, 2010
- Messages
- 126
- Reaction score
- 1
This is part of my monster.cpp
i would like this part
work with a storage, like this
of course what i've done is wrong, but is the perfect example of what i want, someone could help me?
this is the source i use MEGA
void Monster:nThink(uint32_t interval)
{
Creature:nThink(interval);
if(despawn())
{
g_game.removeCreature(this, true);
setIdle(true);
return;
}
updateIdleStatus();
if(isIdle)
return;
if(teleportToMaster && doTeleportToMaster())
teleportToMaster = false;
addEventWalk();
if(isSummon())
{
if(!attackedCreature)
{
if(master && master->getAttackedCreature()) //This happens if the monster is summoned during combat
selectTarget(master->getAttackedCreature());
else if(master != followCreature) //Our master has not ordered us to attack anything, lets follow him around instead.
setFollowCreature(master);
}
else if(attackedCreature == this)
setFollowCreature(NULL);
else if(followCreature != attackedCreature) //This happens just after a master orders an attack, so lets follow it aswell.
setFollowCreature(attackedCreature);
}
else if(!targetList.empty())
{
if(!followCreature || !hasFollowPath)
searchTarget();
else if(isFleeing() && attackedCreature && !canUseAttack(getPosition(), attackedCreature))
searchTarget(TARGETSEARCH_ATTACKRANGE);
}
onThinkTarget(interval);
onThinkYell(interval);
onThinkDefense(interval);
}
{
Creature:nThink(interval);
if(despawn())
{
g_game.removeCreature(this, true);
setIdle(true);
return;
}
updateIdleStatus();
if(isIdle)
return;
if(teleportToMaster && doTeleportToMaster())
teleportToMaster = false;
addEventWalk();
if(isSummon())
{
if(!attackedCreature)
{
if(master && master->getAttackedCreature()) //This happens if the monster is summoned during combat
selectTarget(master->getAttackedCreature());
else if(master != followCreature) //Our master has not ordered us to attack anything, lets follow him around instead.
setFollowCreature(master);
}
else if(attackedCreature == this)
setFollowCreature(NULL);
else if(followCreature != attackedCreature) //This happens just after a master orders an attack, so lets follow it aswell.
setFollowCreature(attackedCreature);
}
else if(!targetList.empty())
{
if(!followCreature || !hasFollowPath)
searchTarget();
else if(isFleeing() && attackedCreature && !canUseAttack(getPosition(), attackedCreature))
searchTarget(TARGETSEARCH_ATTACKRANGE);
}
onThinkTarget(interval);
onThinkYell(interval);
onThinkDefense(interval);
}
i would like this part
else if(master != followCreature) //Our master has not ordered us to attack anything, lets follow him around instead.
else if((master != followCreature) && (getStorage(9467, 1)) //Our master has not ordered us to attack anything, lets follow him around instead.
of course what i've done is wrong, but is the perfect example of what i want, someone could help me?
this is the source i use MEGA