spawn access requirement can now be enforced with spawn signs to not show title and description
This commit is contained in:
parent
7e5562da32
commit
a1beb6acb0
2 changed files with 16 additions and 3 deletions
|
@ -119,6 +119,7 @@ Spawn::Spawn(){
|
|||
pickup_unique_item_id = 0;
|
||||
disable_sounds = false;
|
||||
has_quests_required = false;
|
||||
has_history_required = false;
|
||||
is_flying_creature = false;
|
||||
is_water_creature = false;
|
||||
region_map = nullptr;
|
||||
|
@ -410,12 +411,18 @@ void Spawn::InitializeFooterPacketData(Player* player, PacketStruct* footer) {
|
|||
footer->setDataByName("widget_x", sign->GetWidgetX());
|
||||
footer->setDataByName("widget_y", sign->GetWidgetY());
|
||||
footer->setDataByName("widget_z", sign->GetWidgetZ());
|
||||
|
||||
int8 showSignText = 1;
|
||||
if((HasQuestsRequired() || HasHistoryRequired()) && !MeetsSpawnAccessRequirements(player)) {
|
||||
showSignText = 0;
|
||||
}
|
||||
|
||||
if (sign->GetSignTitle())
|
||||
footer->setMediumStringByName("title", sign->GetSignTitle());
|
||||
if (sign->GetSignDescription())
|
||||
footer->setMediumStringByName("description", sign->GetSignDescription());
|
||||
footer->setDataByName("sign_distance", sign->GetSignDistance());
|
||||
footer->setDataByName("show", 1);
|
||||
footer->setDataByName("show", showSignText);
|
||||
// in live we see that the language is set when the player does not have it, otherwise its left as 00's.
|
||||
if(!player->HasLanguage(sign->GetLanguage())) {
|
||||
footer->setDataByName("language", sign->GetLanguage());
|
||||
|
@ -2004,11 +2011,14 @@ void Spawn::SetQuestsRequired(int32 quest_id, int16 quest_step){
|
|||
m_requiredQuests.releasewritelock(__FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
bool Spawn::HasQuestsRequired()
|
||||
{
|
||||
bool Spawn::HasQuestsRequired(){
|
||||
return has_quests_required;
|
||||
}
|
||||
|
||||
bool Spawn::HasHistoryRequired(){
|
||||
return has_history_required;
|
||||
}
|
||||
|
||||
void Spawn::SetRequiredHistory(int32 event_id, int32 value1, int32 value2){
|
||||
LUAHistory* set_value = new LUAHistory();
|
||||
set_value->Value = value1;
|
||||
|
@ -2023,6 +2033,7 @@ void Spawn::SetRequiredHistory(int32 event_id, int32 value1, int32 value2){
|
|||
required_history[event_id] = set_value;
|
||||
safe_delete(tmp_value);
|
||||
}
|
||||
has_history_required = true;
|
||||
m_requiredHistory.releasewritelock(__FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
|
|
|
@ -1033,6 +1033,7 @@ public:
|
|||
void SetQuestsRequired(Spawn* new_spawn);
|
||||
void SetQuestsRequired(int32 quest_id, int16 quest_step);
|
||||
bool HasQuestsRequired();
|
||||
bool HasHistoryRequired();
|
||||
void SetRequiredHistory(int32 event_id, int32 value1, int32 value2);
|
||||
void SetTransporterID(int32 id);
|
||||
int32 GetTransporterID();
|
||||
|
@ -1289,6 +1290,7 @@ public:
|
|||
protected:
|
||||
|
||||
bool has_quests_required;
|
||||
bool has_history_required;
|
||||
bool send_spawn_changes;
|
||||
bool invulnerable;
|
||||
bool attack_resume_needed;
|
||||
|
|
Loading…
Add table
Reference in a new issue