Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
example_misc.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/* ScriptData
7SDName: Example_Misc
8SD%Complete: 100
9SDComment: Item, Areatrigger and other small code examples
10SDCategory: Script Examples
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "Player.h"
15
17{
18 public:
19 AT_example_areatrigger() : AreaTriggerScript("example_areatrigger") { }
20
21 bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/) OVERRIDE
22 {
23 player->Kill(player);
24 return true;
25 }
26};
27
29{
30 public:
31 ItemUse_example_item() : ItemScript("example_item") { }
32
33 bool OnUse(Player* /*player*/, Item* /*item*/, SpellCastTargets const& /*targets*/) OVERRIDE
34 {
35 sScriptMgr->LoadDatabase();
36 return true;
37 }
38};
39
41{
42 public:
43 GOHello_example_go_teleporter() : GameObjectScript("example_go_teleporter") { }
44
45 bool OnGossipHello(Player* player, GameObject* /*go*/) OVERRIDE
46 {
47 player->TeleportTo(0, 1807.07f, 336.105f, 70.3975f, 0.0f);
48 return false;
49 }
50};
51
#define OVERRIDE
Definition Define.h:60
#define sScriptMgr
Definition ScriptMgr.h:764
bool OnTrigger(Player *player, AreaTriggerEntry const *) OVERRIDE
AreaTriggerScript(const char *name)
bool OnGossipHello(Player *player, GameObject *) OVERRIDE
GameObjectScript(const char *name)
Definition Item.h:202
ItemScript(const char *name)
bool OnUse(Player *, Item *, SpellCastTargets const &) OVERRIDE
void AddSC_example_misc()