bool ArtisanManager::getRadioactiveSample(PlayerObject* player, CurrentResource* resource, SurveyTool* tool) { uint32 resType = resource->getType()->getCategoryId(); uint16 resPE = resource->getAttribute(ResAttr_PE); //these are the radioactive types if(resType == 477 || resType == 476 /* || resType == 475*/) { //did we already warn the player on the wounds ??? if(!player->getSampleData()->mPassRadioactive) { //UI Integration WindowAsyncContainerCommand* asyncContainer = new WindowAsyncContainerCommand(Window_Query_Radioactive_Sample); asyncContainer->PlayerId = player->getId(); asyncContainer->ToolId = tool->getId(); asyncContainer->CurrentResource = resource; gUIManager->createNewMessageBox(this,"radioactiveSample","@survey:radioactive_sample_t","@survey:radioactive_sample_d",player,SUI_Window_SmplRadioactive_MsgBox, SUI_MB_YESNO,asyncContainer); //Pause Sampling player->getSampleData()->mPendingSample = false; return true; } Ham* hamz = player->getHam(); uint32 playerBF = hamz->getBattleFatigue(); uint32 woundDmg = 50*(1 + (playerBF/100)) + (50*(1 + (resPE/1000))); uint32 bfDmg = static_cast<uint32>(0.075*resPE); uint32 hamReduc = 100*(2+ (resPE/1000)); if(resPE >= 500) { //wound and BF dmg hamz->updateBattleFatigue(bfDmg); hamz->updatePropertyValue(HamBar_Health,HamProperty_Wounds, woundDmg); hamz->updatePropertyValue(HamBar_Action,HamProperty_Wounds, woundDmg); hamz->updatePropertyValue(HamBar_Mind,HamProperty_Wounds, woundDmg); } //this should be a timed debuff per instance -- Do not cause wounds unless potential energy >= 500 // each time a radioactive is sampled, there is a 5 minute debuff // this currently doesn't work properly as when the debuff wears off, the buff class doesn't ensure // we don't have more ham than we should. BuffAttribute* healthdebuffAttribute = new BuffAttribute(attr_health, -(int)hamReduc,0,hamReduc); Buff* healthdebuff = Buff::SimpleBuff(player, player, 300000,0, gWorldManager->GetCurrentGlobalTick()); healthdebuff->AddAttribute(healthdebuffAttribute); player->AddBuff(healthdebuff,true); healthdebuffAttribute = new BuffAttribute(attr_action, -(int)hamReduc,0,hamReduc); healthdebuff = Buff::SimpleBuff(player, player, 300000, 0, gWorldManager->GetCurrentGlobalTick()); healthdebuff->AddAttribute(healthdebuffAttribute); player->AddBuff(healthdebuff,true); } else return false; return true; }
void MissionManager::checkDancerMission(PlayerObject* player) { Datapad* datapad = dynamic_cast<Datapad*>(player->getEquipManager()->getEquippedObject(CreatureEquipSlot_Datapad)); if(datapad->hasMission()) //player has a mission { MissionList::iterator it = datapad->getMissions()->begin(); while(it != datapad->getMissions()->end()) { MissionObject* mission = dynamic_cast<MissionObject*>(*it); if(mission->getMissionType() == dancer) { if(mission->getInProgress()) { ++it; continue; } if(glm::distance(player->mPosition, mission->getDestination().Coordinates) < 20) { BuffAttribute* performance_timer = new BuffAttribute(Mission_Timer, 0,0,0); Buff* timer = Buff::SimpleBuff(player, player, 600000, 0, gWorldManager->GetCurrentGlobalTick()); timer->AddAttribute(performance_timer); player->AddBuff(timer); mission->setInProgress(true); } } ++it; } } return; }