mirror of
https://github.com/araxiaonline/mod-worgoblin.git
synced 2026-06-13 03:02:26 -04:00
Add actual module code.
Adds announcement part and scripts the damage for Rocket Barrage.
This commit is contained in:
@@ -1 +0,0 @@
|
||||
|
||||
6
conf/mod_worgoblin.conf.dist
Normal file
6
conf/mod_worgoblin.conf.dist
Normal file
@@ -0,0 +1,6 @@
|
||||
[worldserver]
|
||||
|
||||
# Enable the module announcing its presence.
|
||||
# Default: true
|
||||
|
||||
Announce.enable=true
|
||||
56
src/Worgoblin.cpp
Normal file
56
src/Worgoblin.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
#include "worgoblin_loader.h"
|
||||
#include "Chat.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Config.h"
|
||||
|
||||
class announce : public PlayerScript {
|
||||
|
||||
public:
|
||||
announce() : PlayerScript("announce") { }
|
||||
|
||||
void OnLogin(Player* player) override
|
||||
{
|
||||
if (sConfigMgr->GetOption<bool>("Announce.enable", true))
|
||||
{
|
||||
ChatHandler(player->GetSession()).SendSysMessage("This server is running the Worgoblin module."); // Hell yea
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class rocket_barrage : public SpellScriptLoader //ID=69041
|
||||
{
|
||||
public:
|
||||
rocket_barrage() : SpellScriptLoader("spell_rocket_barrage") { }
|
||||
|
||||
class rocket_barrage_script : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(rocket_barrage_script);
|
||||
|
||||
void HandleDamage(SpellEffIndex effIndex)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
int32 basePoints = 0 + caster->getLevel() * 2;
|
||||
basePoints += caster->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask()) * 0.429; //BM=0.429 here, don't ask me how.
|
||||
basePoints += caster->GetTotalAttackPowerValue(caster->getClass() != CLASS_HUNTER ? BASE_ATTACK : RANGED_ATTACK) * 0.25; // 0.25=BonusCoefficient, hardcoding it here
|
||||
SetEffectValue(basePoints);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectLaunchTarget += SpellEffectFn(rocket_barrage_script::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new rocket_barrage_script;
|
||||
}
|
||||
};
|
||||
|
||||
void Add_Worgoblin()
|
||||
{
|
||||
new announce();
|
||||
new rocket_barrage();
|
||||
}
|
||||
6
src/worgoblin_loader.h
Normal file
6
src/worgoblin_loader.h
Normal file
@@ -0,0 +1,6 @@
|
||||
void Add_Worgoblin();
|
||||
|
||||
void Addmod_worgoblinScripts()
|
||||
{
|
||||
Add_Worgoblin();
|
||||
}
|
||||
Reference in New Issue
Block a user