roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,188
- Solutions
- 34
- Reaction score
- 200
i have this function in my sources:
Player* player = attackedCreature->getPlayer();
std::string value;
std::string check = "1";
if (getName() == "Rat" && player && ( !(player->getStorage("400",value)) || check != value ) )
{
setFollowCreature(NULL);
setAttackedCreature(NULL);
searchTarget(TARGETSEARCH_NEAREST);
}
If a player have storage 400 and value 1, the monster Rat will atack a player [OK]
If a player have storage 400 and value different 1, the monster rat dont attack a player [OK]
but if the player have a summon, the rat will attack the summon, Independent if player have or not a storage 400!
How can I change this script to monster rat check if target is a summon, and if is a summon, dont attack?
Player* player = attackedCreature->getPlayer();
std::string value;
std::string check = "1";
if (getName() == "Rat" && player && ( !(player->getStorage("400",value)) || check != value ) )
{
setFollowCreature(NULL);
setAttackedCreature(NULL);
searchTarget(TARGETSEARCH_NEAREST);
}
If a player have storage 400 and value 1, the monster Rat will atack a player [OK]
If a player have storage 400 and value different 1, the monster rat dont attack a player [OK]
but if the player have a summon, the rat will attack the summon, Independent if player have or not a storage 400!
How can I change this script to monster rat check if target is a summon, and if is a summon, dont attack?