Add infos into target window
[ryzomcore.git] / ryzom / server / src / sabrina / phrase_utilities_functions.h
blob70628d3e23fa1dfdbd72a3c7344baace6238ae8e
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef EGS_PHRASE_UTILITIES_FUNCTIONS_H
20 #define EGS_PHRASE_UTILITIES_FUNCTIONS_H
23 // misc
24 #include "nel/misc/types_nl.h"
25 // game_share
26 #include "game_share/mode_and_behaviour.h"
27 #include "game_share/armor_types.h"
28 #include "game_share/damage_types.h"
29 #include "game_share/shield_types.h"
30 #include "game_share/slot_equipment.h"
31 #include "game_share/weapon_types.h"
32 #include "game_share/creature_size.h"
33 #include "game_share/intensity_types.h"
34 #include "game_share/entity_action.h"
35 #include "game_share/sentence_appraisal.h"
37 #include "entity_base.h"
41 // Stuff used for management of log messages
42 extern bool VerboseBrickManagerInfo;
43 #define INFOLOG if (!VerboseBrickManagerInfo) {} else nlinfo
45 extern bool VerboseBrickManagerDbg;
46 #define DEBUGLOG if (!VerboseBrickManagerDbg) {} else nldebug
48 extern bool AggroLog;
49 #define AGGROLOG if (!AggroLog) {} else nlinfo
52 namespace PHRASE_UTILITIES
55 enum ERange
57 UNDEFINED = 0,
58 POINT_BLANK, // bout-portant
59 SHORT_RANGE,
60 MEDIUM_RANGE,
61 LONG_RANGE,
62 OUT_OF_RANGE,
66 /**
67 * convert a ERange value to the corresponding string
69 std::string toString(ERange range);
71 #define HANDS_DAMAGE_FACTOR_MULTIPLIER 0.8
73 typedef std::pair<SLOT_EQUIPMENT::TSlotEquipment,bool> TPairSlotShield;
74 typedef std::pair<uint8, uint16> TPairUInt8UInt16;
76 /**
77 * struct for damage localisation
78 * \author David Fleury
79 * \author Nevrax France
80 * \date 2002
82 struct SLocalisation
84 uint8 LocalisationNumber;
86 SHIELDTYPE::EShieldType ShieldType;
87 SLOT_EQUIPMENT::TSlotEquipment Slot;
88 bool ShieldIsEffective;
91 SLocalisation()
93 Slot = SLOT_EQUIPMENT::UNDEFINED;
94 ShieldType = SHIELDTYPE::NONE;
95 ShieldIsEffective = false;
96 LocalisationNumber = 0;
99 /// egality operator
100 inline bool operator == ( const SLocalisation& p ) const
102 return ( ( ShieldType == p.ShieldType ) && ( LocalisationNumber == p.LocalisationNumber ) );
105 /// < operator
106 inline bool operator <( const SLocalisation& p ) const
108 if ( LocalisationNumber < p.LocalisationNumber )
109 return true;
110 else if ( (LocalisationNumber == p.LocalisationNumber ) && ShieldType < p.ShieldType )
111 return true;
112 else
113 return false;
118 * get a pointer on the CEntityBase object related to the specified entity Id
119 * \param id the entity id
120 * \return pointer on the CEntityBase object, or NULL if not found
122 CEntityBase* entityPtrFromId( const NLMISC::CEntityId &id );
125 * get a pointer on the CEntityBase object related to the specified datasetrow
126 * \param entityRowId the entity datasetrow
127 * \return pointer on the CEntityBase object, or NULL if not found
129 inline CEntityBase* entityPtrFromId( const TDataSetRow &entityRowId )
131 if (entityRowId.isValid() && TheDataset.isDataSetRowStillValid(entityRowId))
133 return entityPtrFromId( TheDataset.getEntityId( entityRowId ) );
135 else
136 return NULL;
141 * get the chance of sucess for a relative level
142 * \param playerRelativeLevel relative level of the player
143 * \return chance of success
145 uint8 getSuccessChance( sint32 playerRelativeLevel );
149 * get Success Factor
150 * \param chance of success (5 - 95)
151 * \param tirage (0 - 100 )
152 * \return 1.1 for critical success
153 * \return 1.0 for success
154 * \return 1 < SF < 0 for partial success
155 * \return for failure
156 * \return SF < 0 for critical failure
158 float getSucessFactor( uint8 chances, uint8 tirage );
162 * test the target is a valid target for Combat
163 * \param targetId the target entity Id
164 * \param errorCode reference on the string that will receive the error code if any
165 * \return true if the target is valid, false otherwise
167 bool testTargetValidityForCombat( const NLMISC::CEntityId &targetId, std::string &errorCode );
170 * test the target is a valid target for Combat
171 * \param targetId the target entity Id
172 * \param errorCode reference on the string that will receive the error code if any
173 * \return true if the target is valid, false otherwise
175 inline bool testTargetValidityForCombat( const TDataSetRow &entityRowId, std::string &errorCode )
177 if ( entityRowId.isValid() && TheDataset.isDataSetRowStillValid(entityRowId) )
178 return testTargetValidityForCombat( TheDataset.getEntityId(entityRowId), errorCode );
179 else
180 return false;
184 * get the damage localisation
185 * \param shield the shield used by the target
186 * \param forcedSlot the hit slot MUST be of this type, but the effectiveness of the shield is still to be determined
187 * \param adjustement the adjustement (for size for exemple)
188 * \return a pair indicating the slot hit and the effectiveness of the shield (true = shield is effective)
190 TPairSlotShield getLocalisation( SHIELDTYPE::EShieldType shield = SHIELDTYPE::NONE, sint8 adjustement = 0, SLOT_EQUIPMENT::TSlotEquipment forcedSlot = SLOT_EQUIPMENT::UNDEFINED);
193 * get the localisation size adjustment
194 * \param attacker Id of the attacker
195 * \param defender Id of the defender
196 * \return the adjustement value
198 sint8 getLocalisationSizeAdjustement( const NLMISC::CEntityId &attacker, const NLMISC::CEntityId &defender );
200 inline sint8 getLocalisationSizeAdjustement( const TDataSetRow &attackerRowId, const TDataSetRow &defenderRowId )
202 if (attackerRowId.isValid() && TheDataset.isDataSetRowStillValid(attackerRowId) && defenderRowId.isValid() && TheDataset.isDataSetRowStillValid(defenderRowId))
203 return getLocalisationSizeAdjustement( TheDataset.getEntityId(attackerRowId), TheDataset.getEntityId(defenderRowId) );
204 else
205 return 0;
210 * get the weapon damage factor
211 * \param type the weapon type (LIGHT, MEDIUM, HEAVY...)
212 * \param quality the weapon quality
213 * \param entityLevel the level of the entity using this weapon (default = 0 -> no influence on damage factor)
214 * \return the weapon damage factor
216 float getWeaponDamageFactor( WEAPONTYPE::EWeaponType type, uint16 quality, uint16 entityLevel = 0 );
219 * get the armor protection characteritics (protection in % and max protection points)
220 * \param type the armor type (LIGHT, MEDIUM, HEAVY...)
221 * \param quality the armor quality
222 * \return the armor charac
224 TPairUInt8UInt16 getArmorCharacteristics( ARMORTYPE::EArmorType type, uint16 quality );
228 * load the localisation table
229 * \param name and path of the file to load
231 void loadLocalisationTable( const std::string &tableName );
235 * load the localisation size adjusment table
236 * \param name and path of the file to load
238 void loadLocalisationSizeAdjusmentTable( const std::string &tableName );
242 * get the entity level in the specified skill and specialization
243 * \param entityId the entity NLMISC::CEntityId
244 * \param skill the skill used
245 * \param skillModifier bonus/malus applied on skill level (-20 = -2 level)
246 * \param skillMultiplier factor on skill value (>0)
247 * \return the entity level (uint32)
249 uint32 getEntityLevel( const NLMISC::CEntityId &entityId, SKILLS::ESkills skill, sint32 skillModifier = 0, float skillMultiplier = 1.0f);
250 inline uint32 getEntityLevel( const TDataSetRow &entityRowId, SKILLS::ESkills skill, sint32 skillModifier = 0,float skillMultiplier = 1.0f)
252 if ( entityRowId.isValid() && TheDataset.isDataSetRowStillValid(entityRowId) )
254 return getEntityLevel( TheDataset.getEntityId(entityRowId), skill, skillModifier, skillMultiplier);
256 else
257 return 0;
262 * get the entity level in the specified score
263 * \param entityId the entity NLMISC::CEntityId
264 * \param score the scor used
265 * \param scoreModifier bonus/malus applied on score (-20 = -2 level)
266 * \param scoreMultiplier factor applied on score
267 * \return the entity level (uint32)
269 uint32 getEntityLevel( const NLMISC::CEntityId &entityId, SCORES::TScores score, sint32 scoreModifier = 0, float scoreMultiplier = 1.0f );
270 inline uint32 getEntityLevel( const TDataSetRow &entityRowId, SCORES::TScores score, sint32 scoreModifier = 0, float scoreMultiplier = 1.0f )
272 if ( entityRowId.isValid() && TheDataset.isDataSetRowStillValid(entityRowId) )
274 return getEntityLevel( TheDataset.getEntityId(entityRowId), score, scoreModifier, scoreMultiplier );
276 else
277 return 0;
281 * get the distance between two entities
282 * \param entity1 the first entity
283 * \param entity2 the second entity
284 * \return the distance in meters, -1 if invalid entities or properties not found
286 double getDistance( const NLMISC::CEntityId &entity1, const NLMISC::CEntityId &entity2 );
287 inline double getDistance( const TDataSetRow &entity1RowId, const TDataSetRow &entity2RowId )
289 if ( entity1RowId.isValid() && TheDataset.isDataSetRowStillValid(entity1RowId) && entity2RowId.isValid() && TheDataset.isDataSetRowStillValid(entity2RowId) )
291 return getDistance( TheDataset.getEntityId(entity1RowId), TheDataset.getEntityId(entity2RowId) );
293 else
294 return 0.0;
300 * inflict damage to the specified Item
301 * \param ownerId the NLMISC::CEntityId of the item's owner
302 * \param slot the slot where this item is stored
303 * \param damage the amount of damage dealt to the item
305 //void inflictDamageOnItem( const NLMISC::CEntityId &itemId, SLOT_EQUIPMENT::TSlotEquipment slot, sint32 damage );
308 * inflict damage to the specified Item
309 * \param itemPtr pointre on the CGameItem to damage
310 * \param damage the amount of damage dealt to the item
312 //void inflictDamageOnItem( CGameItemPtr itemPtr, sint32 damage );
315 * send Death messages when an entity kills another one
316 * \param killerId NLMISC::CEntityId of the acting entity (the one which kills the other one)
317 * \param deadId NLMISC::CEntityId of the dead entity
319 void sendDeathMessages( const NLMISC::CEntityId &killerId, const NLMISC::CEntityId &deadId );
320 inline void sendDeathMessages( const TDataSetRow &killerRowId, const TDataSetRow &deadRowId )
322 if (killerRowId.isValid() && TheDataset.isDataSetRowStillValid(killerRowId) && deadRowId.isValid() && TheDataset.isDataSetRowStillValid(deadRowId))
324 sendDeathMessages( TheDataset.getEntityId( killerRowId ), TheDataset.getEntityId( deadRowId ) );
330 * an entity hits another entity, send all relevant messages to the entities around
331 * \param aggressorId NLMISC::CEntityId of the acting entity (the one which deals damage)
332 * \param victimId NLMISC::CEntityId of the victim entity
333 * \param sentence pointer on the calling sentence if any
334 * \param amount the amount of damage dealt to the victim entity
335 * \param lostStamina the amount of stamina lost by the victim entity
336 * \param lostSap the amount of sap lost by the victim entity
338 void sendHitMessages( const NLMISC::CEntityId &aggressorId, const NLMISC::CEntityId &victimId, sint32 amount, sint32 lostStamina = 0, sint32 lostSap = 0);
340 inline void sendHitMessages( const TDataSetRow &aggressorRowId, const TDataSetRow &victimRowId, sint32 amount, sint32 lostStamina = 0, sint32 lostSap = 0)
342 if (aggressorRowId.isValid() && TheDataset.isDataSetRowStillValid(aggressorRowId) && victimRowId.isValid() && TheDataset.isDataSetRowStillValid(victimRowId) )
344 sendHitMessages( TheDataset.getEntityId( aggressorRowId ), TheDataset.getEntityId( victimRowId ), amount, lostStamina, lostSap );
349 * an entity hits another entity but does no damage, send all relevant messages to the entities around
350 * \param aggressorId NLMISC::CEntityId of the acting entity (the one which deals damage)
351 * \param victimId NLMISC::CEntityId of the victim entity
353 void sendHitNullMessages( const NLMISC::CEntityId &aggressorId, const NLMISC::CEntityId &victimId );
354 inline void sendHitNullMessages( const TDataSetRow &aggressorRowId, const TDataSetRow &victimRowId )
356 if (aggressorRowId.isValid() && TheDataset.isDataSetRowStillValid(aggressorRowId) && victimRowId.isValid() && TheDataset.isDataSetRowStillValid(victimRowId))
358 sendHitNullMessages( TheDataset.getEntityId( aggressorRowId ), TheDataset.getEntityId( victimRowId ) );
363 * fumble messages
364 * \param aggressorId NLMISC::CEntityId of the acting entity
365 * \param victimId NLMISC::CEntityId of the targeted entity
367 void sendFumbleMessage( const NLMISC::CEntityId &aggressorId, const NLMISC::CEntityId &victimId );
368 inline void sendFumbleMessage( const TDataSetRow &aggressorRowId, const TDataSetRow &victimRowId )
370 if (aggressorRowId.isValid() && TheDataset.isDataSetRowStillValid(aggressorRowId) && victimRowId.isValid() && TheDataset.isDataSetRowStillValid(victimRowId))
372 sendFumbleMessage( TheDataset.getEntityId( aggressorRowId ), TheDataset.getEntityId( victimRowId ) );
379 * an entity resits the use of a strategy of another entity, send all relevant messages to the entities around and the entites concerned
380 * \param aggressorId NLMISC::CEntityId of the acting entity
381 * \param victimId NLMISC::CEntityId of the victim entity
383 void sendCombatResistMessages( const NLMISC::CEntityId &aggressorId, const NLMISC::CEntityId &victimId );
386 * an entity resits the use of a strategy of another entity, send all relevant messages to the entities around and the entites concerned
387 * \param aggressorRowId row id of the acting entity
388 * \param victimRowId row id of the victim entity
390 inline void sendCombatResistMessages( const TDataSetRow &aggressorRowId, const TDataSetRow &victimRowId )
392 if (aggressorRowId.isValid() && TheDataset.isDataSetRowStillValid(aggressorRowId) && victimRowId.isValid() && TheDataset.isDataSetRowStillValid(victimRowId))
394 sendCombatResistMessages( TheDataset.getEntityId( aggressorRowId ), TheDataset.getEntityId( victimRowId ) );
400 * send a simple (only a string) message to the specified entity (or chat group)
401 * \param entityId CEntityId of the entity to whom the message is sent
402 * \param msgName name of the message
404 void sendSimpleMessage( const NLMISC::CEntityId &entityId, const std::string &msgName );
405 inline void sendSimpleMessage( const TDataSetRow &entityRowId, const std::string &msgName )
407 if (entityRowId.isValid() && TheDataset.isDataSetRowStillValid(entityRowId) )
409 sendSimpleMessage( TheDataset.getEntityId( entityRowId ), msgName );
415 * send a message with a string param to the specified entity (or chat group)
416 * \param entityId CEntityId of the entity to whom the message is sent
417 * \param msgName name of the message
418 * \param txt the text param
420 void sendMessage( const NLMISC::CEntityId &entityId, const std::string &msgName, const ucstring &txt );
423 * send a message with a string param to the specified entity (or chat group)
424 * \param entityId CEntityId of the entity to whom the message is sent
425 * \param msgName name of the message
426 * \param entityIdForText entityId which name appears in the message
428 void sendMessage( const NLMISC::CEntityId &entityId, const std::string &msgName, const NLMISC::CEntityId &entityIdForText );
429 inline void sendMessage( const TDataSetRow &entityRowId, const std::string &msgName, const TDataSetRow &entityRowIdForText )
431 if (entityRowId.isValid() && TheDataset.isDataSetRowStillValid(entityRowId) && entityRowIdForText.isValid() && TheDataset.isDataSetRowStillValid(entityRowIdForText) )
432 sendMessage( TheDataset.getEntityId( entityRowId ), msgName, TheDataset.getEntityId( entityRowIdForText ) );
437 * send a dynamic message to the chat
438 * \param entityId CEntityId of the entity executiong a sentence
439 * \param msgText text of the message
441 void sendDynamicChatMessage( const NLMISC::CEntityId &entityId, const std::string &msgText );
445 * send a message to the GPMS requesting all the entities of chosen types in a circle of specified radius around the target entity
446 * \param target Id of the targeted entity (must be valid)
447 * \param radius radius of the circle in meters
448 * \param validTargets list of valid target types
449 * \param sentence the calling sentence (needed to find it when the GPMS answer)
451 //void sendAreaRequest( const NLMISC::CEntityId &targetEntity, float radius, const std::list<RYZOMID::ETypeId> &validTypes, CSentence *sentence);
455 * send a message to update an entity behaviour, sent to the OPS or to the AGG
456 * \param entityId id of the entity changing it's behaviour
457 * \param behaviour the new entity behaviour
459 void sendUpdateBehaviour( const NLMISC::CEntityId &entityId, const MBEHAV::CBehaviour &behaviour, bool forceUpdate = false );
462 * send a message to update an entity behaviour, sent to the OPS or to the AGG
463 * \param entityRowId row id of the entity changing it's behaviour
464 * \param behaviour the new entity behaviour
466 inline void sendUpdateBehaviour( const TDataSetRow &entityRowId, const MBEHAV::CBehaviour &behaviour, bool forceUpdate = false )
468 if (entityRowId.isValid())
470 sendUpdateBehaviour( TheDataset.getEntityId( entityRowId ), behaviour, forceUpdate );
476 * an entity engage another entity in melee combat
477 * \param entityId the active entity Id
478 * \param targetId the entity being engaged
479 * \param mode the mode of the engagement (default = 1 = normal)
480 * \return true if the target has been engaged, false otherwise
482 bool engageTargetInMelee( const NLMISC::CEntityId &entityId , const NLMISC::CEntityId &targetId , sint8 mode = 1);
486 * an entity engage another entity in range combat
487 * \param entityId the active entity Id
488 * \param targetId the entity being engaged
489 * \return true if the target has been engaged, false otherwise
491 bool engageTargetRange( const NLMISC::CEntityId &entityId , const NLMISC::CEntityId &targetId );
495 * send engage messages to clients
496 * \param aggressorId id of the attacking entity
497 * \param victimId id of the attacked entity
499 void sendEngageMessages( const NLMISC::CEntityId &aggressorId, const NLMISC::CEntityId &victimId );
502 * send disengage messages to clients
503 * \param aggressorId id of the attacking entity now disengaging from combat
504 * \param victimId id of the attacked entity
506 void sendDisengageMessages( const NLMISC::CEntityId &aggressorId, const NLMISC::CEntityId &victimId );
509 * send spell resists message
510 * \param aggressorId id of the attacking entity
511 * \param victimId id of the attacked entity
513 void sendSpellResistMessages( const TDataSetRow &aggressorRowId, const TDataSetRow &victimRowId );
516 * send spell begin cast message
518 void sendSpellBeginCastMessages( const TDataSetRow &aggressorRowId, const TDataSetRow &victimRowId, ACTNATURE::EActionNature nature );
521 void sendSpellSuccessMessages( const TDataSetRow &aggressorRowId, const TDataSetRow &victimRowId );
522 void sendSpellFailedMessages( const TDataSetRow &aggressorRowId, const TDataSetRow &victimRowId );
523 void sendSpellFumbleMessages( const TDataSetRow &aggressorRowId, const TDataSetRow &victimRowId );
526 * send critical hit messages
527 * \param aggressorId id of the attacking entity
528 * \param victimId id of the attacked entity
530 void sendCriticalHitMessage( const NLMISC::CEntityId &aggressorId, const NLMISC::CEntityId &victimId );
531 inline void sendCriticalHitMessage( const TDataSetRow &aggressorRowId, const TDataSetRow &victimRowId )
533 if ( aggressorRowId.isValid() && TheDataset.isDataSetRowStillValid(aggressorRowId) && victimRowId.isValid() && TheDataset.isDataSetRowStillValid(victimRowId) )
535 sendCriticalHitMessage( TheDataset.getEntityId(aggressorRowId), TheDataset.getEntityId(victimRowId) );
540 * get the relative intensity of the impact according to target
541 * \param impact strength of the impact
542 * \param targetId the target id
543 * \param score the affected score
544 * \return the impact intensity
546 INTENSITY_TYPE::TImpactIntensity getImpactIntensity( sint32 impact, const TDataSetRow &victimRowId, SCORES::TScores score = SCORES::hit_points );
549 * get the intensity of the attack
550 * \param attackLevel level of the attack
551 * \return the attack intensity
553 INTENSITY_TYPE::TAttackIntensity getAttackIntensity( uint32 attackLevel);
556 // get entity skill value
557 inline uint32 getEntitySkill( const NLMISC::CEntityId &entityId, SKILLS::ESkills skill )
559 CEntityBase* entity = entityPtrFromId( entityId );
560 if (entity == NULL)
562 nlwarning("<getEntitySkill> Invalid entity Id %s", entityId.toString().c_str() );
563 return 0;
565 if ( skill < SKILLS::NUM_SKILLS )
567 return entity->getSkills()._Skills[ skill ].Current;
569 return 0;
573 * get the level for a given 'skill'
575 inline uint32 getLevelFromSkill(uint32 comp)
577 /* if (comp % 10 != 0)
579 comp /= 10;
580 ++comp;
582 else
584 comp /= 10;
587 return comp;
589 // 0 -> locked skill 1-9 -> level 0 but unlocked, 10-19 level 1, etc...)
590 return comp /= 10;
594 * get the level for a given 'skill'
596 inline uint32 getLevelFromScore(uint32 scoreValue)
598 //for now we consider scores as skills
599 return getLevelFromSkill(scoreValue);
604 * get the direction (as text) pointed by the specified vector
605 * \param dir the direction vector
606 * \return the direction as a string
608 std::string getOrientationString( const NLMISC::CVector &dir);
611 * get the direction (as text)
613 std::string getOrientationString( sint32 x, sint32 y);
616 * get the current action type for specified entity
617 * \param entityId id of the entity to check
618 * \return the entity action as an enum value
620 ENTITY_ACTION::EEntityAction getEntityCurrentAction( const NLMISC::CEntityId &entityId);
624 * test if an entity spell casting is broken when it has been hit
625 * \param entity pointer on the entity being hit
626 * \param attacker pointer on the entity dealing damage
627 * \param damage amount of damage done
628 * \param weaponType the type of weapon used (if any, optionnal param)
630 void testSpellBreakOnDamage( CEntityBase *entity, CEntityBase * attacker, sint32 damage, WEAPONTYPE::EWeaponType weaponType = WEAPONTYPE::UNKNOWN );
633 * test if PVP or any other offensive action is allowed against target entity
634 * \param actorId if the acting entity
635 * \param targetId if the target entity
636 * \param errorCode the string that will receive the errorCode if any
637 * \return true if an offensive action is allowed
639 bool testOffensiveActionAllowed( const NLMISC::CEntityId &actorId, const NLMISC::CEntityId &targetId, std::string &errorCode);
640 inline bool testOffensiveActionAllowed( const TDataSetRow &actorRowId, const TDataSetRow &targetRowId, std::string &errorCode)
642 return testOffensiveActionAllowed( TheDataset.getEntityId(actorRowId), TheDataset.getEntityId(targetRowId), errorCode);
646 * test if the target of a spell is valid
647 * \param actorRowId spell caster
648 * \param targetRowId target id
649 * \param action nature of the spelll
650 * \return true if allowed
652 inline bool validateSpellTarget( const TDataSetRow &actorRowId, const TDataSetRow &targetRowId, ACTNATURE::EActionNature action )
654 ///\todo nico do something with the error code
655 std::string errorCode;
656 if ( action == ACTNATURE::OFFENSIVE )
658 return PHRASE_UTILITIES::testOffensiveActionAllowed(actorRowId, targetRowId, errorCode);
660 else
662 // defensive spells are allowed on everybody except attackable ones
663 CEntityBase * target = CEntityBaseManager::getEntityBasePtr( targetRowId );
664 return !(target->getContextualProperty().getValue().attackable());
668 /////////////////////////// temp /////////////////////////////////
669 // send dmg spell message
670 void sendScoreModifierSpellMessage( CEntityBase * aggressor, CEntityBase* victim, sint32 value, SCORES::TScores score, ACTNATURE::EActionNature nature );
672 // send heal spell message
674 // send resist message
678 }; // PHRASE_UTILITIES
682 #endif // EGS_PHRASE_UTILITIES_FUNCTIONS_H
684 /* End of phrase_utilities_functions.h */