/* * Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */
/* --[[ Coded by CoC / Lucky_Patcher 2018 || Do not remove this Copyright || You are allowed to modify this script.]]-- */
/*
* Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* --[[ Improved by Ghost_1013 || Coded by CoC / Lucky_Patcher 2018 || Do not remove this Copyright || You are allowed to modify this script.]]-- */
#include "ScriptMgr.h"
#include "Config.h"
#include "Player.h"
#include "World.h"
class duel_reset : public PlayerScript
{
public:
duel_reset() : PlayerScript("duel_reset") { }
void OnDuelEnd(Player* winner, Player* looser, DuelCompleteType type)
{
if (!sWorld->getBoolConfig(CONFIG_DUEL_RESET_COOLDOWN_ON_FINISH))
{
return;
}
if (sWorld->getBoolConfig(CONFIG_DUEL_RESET_COOLDOWN_ONLY_IN_ELWYNN_AND_DUROTAR) && (winner->GetZoneId() != 14 || winner->GetZoneId() != 12))
{
return;
}
if (type == DUEL_WON)
{
winner->RemoveArenaSpellCooldowns();
looser->RemoveArenaSpellCooldowns();
winner->SetHealth(winner->GetMaxHealth());
looser->SetHealth(looser->GetMaxHealth());
if (winner->getPowerType() == POWER_MANA)
winner->SetPower(POWER_MANA, winner->GetMaxPower(POWER_MANA));
if (looser->getPowerType() == POWER_MANA)
looser->SetPower(POWER_MANA, looser->GetMaxPower(POWER_MANA));
}
winner->HandleEmoteCommand(EMOTE_ONESHOT_DANCE);
looser->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
}
void OnDuelStart(Player* player1, Player* player2)
{
if (!sWorld->getBoolConfig(CONFIG_DUEL_RESET_COOLDOWN_ON_START))
{
return;
}
if (sWorld->getBoolConfig(CONFIG_DUEL_RESET_COOLDOWN_ONLY_IN_ELWYNN_AND_DUROTAR) && (player1->GetZoneId() != 14 || player1->GetZoneId() != 12))
{
return;
}
Player* players[2] = {player1, player2};
for(Player* player : players)
{
player->RemoveArenaSpellCooldowns();
player->SetHealth(player->GetMaxHealth());
if (sWorld->getBoolConfig(CONFIG_DUEL_RESET_COOLDOWN_RESET_ENERGY_ON_START))
{
switch (player->getPowerType())
{
case POWER_MANA:
player->SetPower(POWER_MANA, 0);
break;
case POWER_RAGE:
player->SetPower(POWER_RAGE, 0);
break;
case POWER_RUNIC_POWER:
player->SetPower(POWER_RUNIC_POWER, 0);
break;
case POWER_FOCUS:
player->SetPower(POWER_FOCUS, 0);
break;
case POWER_ENERGY:
player->SetPower(POWER_ENERGY, 0);
break;
default:
break;
}
}
if (sWorld->getBoolConfig(CONFIG_DUEL_RESET_COOLDOWN_MAX_ENERGY_ON_START))
{
switch (player->getPowerType())
{
case POWER_MANA:
player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA));
break;
case POWER_RAGE:
player->SetPower(POWER_RAGE, player->GetMaxPower(POWER_RAGE));
break;
case POWER_RUNIC_POWER:
player->SetPower(POWER_RUNIC_POWER, player->GetMaxPower(POWER_RUNIC_POWER));
break;
case POWER_FOCUS:
player->SetPower(POWER_FOCUS, player->GetMaxPower(POWER_FOCUS));
break;
case POWER_ENERGY:
player->SetPower(POWER_ENERGY, player->GetMaxPower(POWER_ENERGY));
break;
default:
break;
}
}
}
}
};
void AddSC_DuelReset()
{
new duel_reset();
}
Der Code sollte äquivalent sein, ist aber leserlicher.
/*
* Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* --[[ Improved by Ghost_1013 || Coded by CoC / Lucky_Patcher 2018 || Do not remove this Copyright || You are allowed to modify this script.]]-- */
Custom Script auf TrinityCore funktioniert nicht 04/01/2014 - WoW Private Server - 3 Replies Guten Abend Community..
Wollte vorhin anfangen ein paar "Customscripts" (C++) auf meinen Server zu packen.
Bin nach diesem Tutorial vorgegangen (für Linux):
How-to_CustomScript
Sprich in die ScriptLoader.cpp eingefügt:
#ifdef SCRIPTS
/* This is where custom scripts' loading functions should be declared. */
void AddSC_professions_npc();
Custom Script auf TrinityCore funktioniert nicht 04/01/2014 - WoW Private Server - 1 Replies Guten Abend Community..
Wollte vorhin anfangen ein paar "Customscripts" (C++) auf meinen Server zu packen.
Bin nach diesem Tutorial vorgegangen (für Linux):
How-to_CustomScript
Sprich in die ScriptLoader.cpp eingefügt:
#ifdef SCRIPTS
/* This is where custom scripts' loading functions should be declared. */
void AddSC_professions_npc();
TrinityCore C++ Script Fehler 03/02/2014 - WoW Private Server - 2 Replies Hallo liebe leute,
ich habe mal einen neuen script entdeckt der sich Killstream nennt...
Ich wollte es so in meinem Server haben das man bei dem 10ten Kill anfängt mit den ganzen streaks und es bis zu den 50ten kill geht...
Doch leider habe ich beim kompliren wieder einen fehler...
Und der komplette script:
Danke euch
TrinityCore c++ Script 03/01/2014 - WoW Private Server - 9 Replies Hallo liebe leute,
ich hoffe ihr könnt mir hierbei weiter helfen und zwar habe ich versucht den folgenden script auf meinem server zu bringen folgender script
Es sollt eigentlich ohne probleme gehen aber ich bekomme folgendenen fehler:
Es war auch so als ich es dan entpackt habe hies es nur Trainer(was auch nicht ging) der script hab ich dan umgeändert in SymbolixDEV_NPC.cpp und trozdem klappt es nicht...
Ich danke euch allen!
Fragen zu TrinityCore 09/04/2009 - WoW Private Server - 1 Replies Heyho ich hab da mal paar fragen
-wie erstelle ic hda ei naccoutn bzw brauch ich nen md5 hash?
-was ist der acceslevel von Admin ,gm ,user usw
-und mehr infos dazu wehr nicht shclecht
-und ja noch gm commands (habe leidern ur commands von Mangos/Ascent suche welche für Trinty! 3.1.3!
Mfg