void ObjectController::_handleTendWound(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties) { PlayerObject* Medic = dynamic_cast<PlayerObject*>(mObject); PlayerObject* Target = dynamic_cast<PlayerObject*>(Medic->getHealingTarget(Medic)); //TODO:: add medic droid /*EMLocationType loc = Medic->getPlayerLocation(); if(loc != EMLocation_Cantina || loc != EMLocation_Camp || loc != EMLocation_PlayerStructure) { return; }*/ std::string messageResponse = gMedicManager->handleMessage(message,"(action|constitution|health|quickness|stamina|strength)"); if (messageResponse.length() == 0) { //you must specify a valid wound type gMessageLib->SendSystemMessage(::common::OutOfBand("healing_response", "healing_response_65"), Medic); return; } //check Medic has enough Mind auto ham = gWorldManager->getKernel()->GetServiceManager()->GetService<swganh::ham::HamService>("HamService"); if(!ham->checkMainPools(Medic, 0, 0, 500)) { gMessageLib->SendSystemMessage(::common::OutOfBand("healing_response", "not_enough_mind"), Medic); return; } if (gMedicManager->HealWound(Medic, Target, 0, cmdProperties, messageResponse + "tendwound")) { ham->ApplyWound(Medic, HamBar_Focus, 5); ham->ApplyWound(Medic, HamBar_Willpower, 5); Medic->AddBattleFatigue(2); //call the event gMedicManager->startWoundTreatmentEvent(Medic); return; } }
void ObjectController::_handleHealWound(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties) { PlayerObject* Medic = dynamic_cast<PlayerObject*>(mObject); PlayerObject* Target = dynamic_cast<PlayerObject*>(Medic->getHealingTarget(Medic)); std::string messageResponse = gMedicManager->handleMessage(message,"(action|constitution|health|quickness|stamina|strength)"); if (messageResponse.length() == 0) { //you must specify a valid wound type gMessageLib->SendSystemMessage(::common::OutOfBand("healing_response", "healing_response_65"), Medic); } else { //check Medic has enough Mind Ham* ham = Medic->getHam(); if(ham->checkMainPools(0, 0, 140)) { if (gMedicManager->CheckMedicine(Medic, Target, cmdProperties, messageResponse)) { //call the event gMedicManager->startWoundTreatmentEvent(Medic); return; } } else gMessageLib->SendSystemMessage(::common::OutOfBand("healing_response", "not_enough_mind"), Medic); } }
void ObjectController::_handleTendDamage(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties) { PlayerObject* Medic = dynamic_cast<PlayerObject*>(mObject); PlayerObject* Target = dynamic_cast<PlayerObject*>(Medic->getHealingTarget(Medic)); //check Medic has enough Mind auto ham = gWorldManager->getKernel()->GetServiceManager()->GetService<swganh::ham::HamService>("HamService"); if(!ham->checkMainPools(Medic, cmdProperties->mHealthCost, cmdProperties->mActionCost, cmdProperties->mMindCost)){ gMessageLib->SendSystemMessage(::common::OutOfBand("healing_response", "not_enough_mind"), Medic); return; } if (gMedicManager->HealDamage(Medic, Target, 0, cmdProperties, "tendDamage")) { ham->ApplyWound(Medic, HamBar_Focus, 5); ham->ApplyWound(Medic, HamBar_Willpower, 5); Medic->AddBattleFatigue(2); //call the event gMedicManager->startInjuryTreatmentEvent(Medic); return; } }
void ObjectController::_handleHealWound(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties) { CreatureObject* creature = dynamic_cast<CreatureObject*>(mObject); PlayerObject* Medic = creature->GetGhost(); PlayerObject* Target = dynamic_cast<PlayerObject*>(Medic->getHealingTarget(Medic)); std::string messageResponse = gMedicManager->handleMessage(message,"(action|constitution|health|quickness|stamina|strength)"); if (messageResponse.length() == 0) { //you must specify a valid wound type gMessageLib->SendSystemMessage(::common::OutOfBand("healing_response", "healing_response_65"), Medic); } else { //check Medic has enough Mind auto ham = gWorldManager->getKernel()->GetServiceManager()->GetService<swganh::ham::HamService>("HamService"); if(!ham->checkMainPool(Medic->GetCreature(), HamBar_Mind, 140)) { gMessageLib->SendSystemMessage(::common::OutOfBand("healing_response", "not_enough_mind"), Medic); return; } if (gMedicManager->CheckMedicine(Medic, Target, cmdProperties, messageResponse)) { //call the event gMedicManager->startWoundTreatmentEvent(Medic); return; } } }
void ObjectController::_handleHealDamage(uint64 targetId, Message* message,ObjectControllerCmdProperties* cmdProperties) { PlayerObject* Medic = dynamic_cast<PlayerObject*>(mObject); PlayerObject* Target = dynamic_cast<PlayerObject*>(Medic->getHealingTarget(Medic)); mHandlerCompleted = gMedicManager->CheckMedicine(Medic, Target, cmdProperties, stim); if (mHandlerCompleted) { //call the event gMedicManager->startInjuryTreatmentEvent(Medic); } }
void ObjectController::_handleQuickHeal(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties) { PlayerObject* Medic = dynamic_cast<PlayerObject*>(mObject); PlayerObject* Target = dynamic_cast<PlayerObject*>(Medic->getHealingTarget(Medic)); //check Medic has enough Mind Ham* ham = Medic->getHam(); if(ham->checkMainPools(0, 0, cmdProperties->mMindCost)) { if (gMedicManager->HealDamage(Medic, Target, 0, cmdProperties, "quickHeal")) { ham->updatePropertyValue(HamBar_Focus ,HamProperty_Wounds, 10); ham->updatePropertyValue(HamBar_Willpower ,HamProperty_Wounds, 10); ham->updateBattleFatigue(2, true); //call the event gMedicManager->startQuickHealInjuryTreatmentEvent(Medic); return; } } else gMessageLib->SendSystemMessage(::common::OutOfBand("healing_response", "not_enough_mind"), Medic); }
void ObjectController::_handleTendWound(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties) { PlayerObject* Medic = dynamic_cast<PlayerObject*>(mObject); PlayerObject* Target = dynamic_cast<PlayerObject*>(Medic->getHealingTarget(Medic)); //TODO:: add medic droid /*EMLocationType loc = Medic->getPlayerLocation(); if(loc != EMLocation_Cantina || loc != EMLocation_Camp || loc != EMLocation_PlayerStructure) { return; }*/ std::string messageResponse = gMedicManager->handleMessage(message,"(action|constitution|health|quickness|stamina|strength)"); if (messageResponse.length() == 0) { //you must specify a valid wound type gMessageLib->SendSystemMessage(::common::OutOfBand("healing_response", "healing_response_65"), Medic); } else { //check Medic has enough Mind Ham* ham = Medic->getHam(); if(ham->checkMainPools(0, 0, 500)) { if (gMedicManager->HealWound(Medic, Target, 0, cmdProperties, messageResponse + "tendwound")) { ham->updatePropertyValue(HamBar_Focus ,HamProperty_Wounds, 5); ham->updatePropertyValue(HamBar_Willpower ,HamProperty_Wounds, 5); ham->updateBattleFatigue(2, true); //call the event gMedicManager->startWoundTreatmentEvent(Medic); return; } } else gMessageLib->SendSystemMessage(::common::OutOfBand("healing_response", "not_enough_mind"), Medic); } }