Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- No seu arquivo monster.h, procure por isso:
- bool isHostile() {return mType->isHostile;}
- Troque por:
- bool isHostile() const {
- std::string value;
- if(!getStorage("hostile", value))
- return mType->isHostile;
- return booleanString(value);
- }
- No seu monster.cpp, procure por:
- Monster::selectTarget
- Abaixo de:
- if(!isTarget(creature))
- return false;
- Adicione:
- if(!isHostile())
- return false;
- Crie um arquivo chamado passive_system.lua no diretório creaturescripts/scripts, cole isso:
- PASSIVE_BEHAVIOR = {"Deer", "Rabbit"} -- Aqui ficam os monstros que não atacam, mesmo que atacados.
- function onCombat(cid, target)
- if isMonster(target) then
- if not isInArray(PASSIVE_BEHAVIOR, getCreatureName(target)) then
- doCreatureSetStorage(target, "hostile", 1)
- end
- doMonsterSetTarget(target, cid)
- end
- return true
- end
- No arquivo login.lua:
- registerCreatureEvent(cid, "PassiveSystem")
- No arquivo creaturescripts.xml:
- <event type="combat" name="PassiveSystem" event="script" value="passive_system.lua"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement