void EntertainingSessionImplementation::addEntertainerBuffStrength(CreatureObject* creature, int performanceType, float strength) { ManagedReference<CreatureObject*> entertainer = this->entertainer.get(); int buffStrength = getEntertainerBuffStrength(creature, performanceType); float newBuffStrength = buffStrength + strength; float maxBuffStrength = 0.0f; //cap based on enhancement skill if(dancing) { maxBuffStrength = (float) entertainer->getSkillMod("healing_dance_mind"); } else if (playingMusic) { maxBuffStrength = (float) entertainer->getSkillMod("healing_music_mind"); } if(maxBuffStrength > 125.0f) maxBuffStrength = 125.0f; //cap at 125% power //add xp based on % added to buff strength if (newBuffStrength < maxBuffStrength) { healingXp += strength; } else { healingXp += maxBuffStrength - buffStrength; newBuffStrength = maxBuffStrength; } //newBuffStrength = newBuffStrength; setEntertainerBuffStrength(creature, performanceType, newBuffStrength); }
void EntertainingSessionImplementation::addEntertainerBuffStrength(CreatureObject* creature, int performanceType, float strength) { ManagedReference<CreatureObject*> entertainer = this->entertainer.get(); int buffStrength = getEntertainerBuffStrength(creature, performanceType); float newBuffStrength = buffStrength + strength; float maxBuffStrength = 0.0f; //cap based on enhancement skill if(dancing) { maxBuffStrength = (float) entertainer->getSkillMod("healing_dance_mind"); } else if (playingMusic) { maxBuffStrength = (float) entertainer->getSkillMod("healing_music_mind"); } if(maxBuffStrength > 125.0f) maxBuffStrength = 125.0f; //cap at 125% power float factionPerkStrength = entertainer->getSkillMod("private_faction_buff_mind"); ManagedReference<BuildingObject*> building = entertainer->getRootParent().get().castTo<BuildingObject*>(); if (building != NULL && factionPerkStrength > 0 && building->isPlayerRegisteredWithin(entertainer->getObjectID())) { unsigned int buildingFaction = building->getFaction(); unsigned int entFaction = entertainer->getFaction(); PlayerObject* ghost = entertainer->getPlayerObject(); if (ghost != NULL && entFaction != 0 && entFaction == buildingFaction && ghost->getFactionStatus() == FactionStatus::OVERT) { maxBuffStrength += factionPerkStrength; } } //add xp based on % added to buff strength if (newBuffStrength < maxBuffStrength) { healingXp += strength; } else { healingXp += maxBuffStrength - buffStrength; newBuffStrength = maxBuffStrength; } //newBuffStrength = newBuffStrength; setEntertainerBuffStrength(creature, performanceType, newBuffStrength); }