AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
at_ring_of_law Class Reference
Inheritance diagram for at_ring_of_law:
AreaTriggerScript ScriptObject

Public Member Functions

 at_ring_of_law ()
 
bool OnTrigger (Player *player, const AreaTrigger *) override
 
- Public Member Functions inherited from AreaTriggerScript
bool IsDatabaseBound () const override
 
virtual bool OnTrigger (Player *, AreaTrigger const *)
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 

Additional Inherited Members

- Protected Member Functions inherited from AreaTriggerScript
 AreaTriggerScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ at_ring_of_law()

at_ring_of_law::at_ring_of_law ( )
inline
153: AreaTriggerScript("at_ring_of_law") { }
Definition: AreaTriggerScript.h:24

Member Function Documentation

◆ OnTrigger()

bool at_ring_of_law::OnTrigger ( Player player,
const AreaTrigger  
)
inlineoverridevirtual

Reimplemented from AreaTriggerScript.

156 {
157 if (InstanceScript* instance = player->GetInstanceScript())
158 {
159 time_t now = GameTime::GetGameTime().count();
160 if (instance->GetData(TYPE_RING_OF_LAW) == IN_PROGRESS || instance->GetData(TYPE_RING_OF_LAW) == DONE)
161 {
162 return false;
163 }
164 if (now - instance->GetData(DATA_TIME_RING_FAIL) < 2 * 60) // in case of wipe, so people can rez.
165 {
166 return false;
167 }
168
169 instance->SetData(TYPE_RING_OF_LAW, IN_PROGRESS);
170 return true;
171 }
172 return false;
173 }
@ TYPE_RING_OF_LAW
Definition: blackrock_depths.h:40
@ DATA_TIME_RING_FAIL
Definition: blackrock_depths.h:83
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ DONE
Definition: InstanceScript.h:60
Seconds GetGameTime()
Definition: GameTime.cpp:38
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
Definition: InstanceScript.h:142

References DATA_TIME_RING_FAIL, DONE, GameTime::GetGameTime(), WorldObject::GetInstanceScript(), IN_PROGRESS, and TYPE_RING_OF_LAW.