[Релиз]Патч на склонение русских ников by Zic
1 ПОМЕНЯТЬ КОДИРОВКУ ТАБЛИЦЫ CHARACTERS НА UTF8
2 В КОНФИГЕ УСТАНОВИТЬ ЗНАЧЕНИЕ LIMITED NAMES НА "0"
3 ЗАЛИТЬ 2 ТАБЛИЦЫ
4 Установить ПАТЧ Код:
DROP TABLE IF EXISTS `characters_declinedname`;
CREATE TABLE `character_declinedname` (
`guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier',
`genitive` varchar(12) NOT NULL default '',
`dative` varchar(12) NOT NULL default '',
`accusative` varchar(12) NOT NULL default '',
`instrumental` varchar(12) NOT NULL default '',
`prepositional` varchar(12) NOT NULL default '',
PRIMARY KEY (`guid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
DROP TABLE IF EXISTS `playerpets_declinedname`;
CREATE TABLE `character_pet_declinedname` (
`id` int(11) unsigned NOT NULL default '0',
`owner` int(11) unsigned NOT NULL default '0',
`genitive` varchar(12) NOT NULL default '',
`dative` varchar(12) NOT NULL default '',
`accusative` varchar(12) NOT NULL default '',
`instrumental` varchar(12) NOT NULL default '',
`prepositional` varchar(12) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
патч http://filebeam.com/7b97c03ddf93ccefb75afad837aa75ce
============================================
детектор высокого дамага
при нанесенее выше 25к игрока кикает с сервера и игнорит дамаг
http://arcemu.org/forums/index.php?act=attach&type=post&id=669
==============================================
аукцион бот
http://filebeam.com/d76a9fde631cc67feea69d5175987ab0
==============================================
2000+ lua скриптов
http://depositfiles.com/files/ruifljo38
все скрипты в том числе и ВОТЛК
===============================================
продолжение следует
Добавлено (23.04.2009, 14:44)
---------------------------------------------
Эвенты
Index: src/game/Event.cpp
===================================================================
--- src/game/Event.cpp (revision 0)
+++ src/game/Event.cpp (revision 0)
@@ -0,0 +1,304 @@
+/*
+ * Copyright © 2005,2006,2007,2007 MaNGOS <http://www.mangosproject.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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * ------------
+ * create by ispanec (aka Parkur) and RAMZES (aka RAMZES) for mangos
+ */
+#include "Database/DatabaseEnv.h"
+#include "Event.h"
+#include "ProgressBar.h"
+#include "Log.h"
+#include "Timer.h"
+#include "Creature.h"
+#include "World.h"
+//#include "ObjectAccessor.h"
+
+EventManager::~EventManager()
+{
+ for( int i = 0; i < ( int )events.size(); i++ )
+ delete events[i];
+}
+
+EventManager& EventManager::Instance()
+{
+ static EventManager manager;
+ return manager;
+}
+
+void EventManager::LoadFromDB()
+{
+ uint32 count = 0;
+ QueryResult* result = sDatabase.Query( "SELECT"
+ "`EventId`," /*[0]*/
+ "`EventType`," /*[1]*/
+ "`TriggerId`," /*[2]*/
+ "`TriggerCooldown`," /*[3]*/
+ "UNIX_TIMESTAMP(`StartDate`)," /*[4]*/
+ "UNIX_TIMESTAMP(`EndDate`)," /*[5]*/
+ "`Period`," /*[6]*/
+ "`ZoneId`," /*[7]*/
+ "`QuestId`," /*[8]*/
+ "`GameObjId`," /*[9]*/
+ "`CreatureId`," /*[10]*/
+ "`X`," /*[11]*/
+ "`Y`," /*[12]*/
+ "`Z`," /*[13]*/
+ "`Angle`," /*[14]*/
+ "`SpwType`," /*[15]*/
+ "`DespwTime`," /*[16]*/
+ "`Message`" /*[17]*/
+ "FROM `Events`" );
+
+ if(!result)
+ {
+ barGoLink bar( 1 );
+ bar.step();
+ sLog.outString( "" );
+ sLog.outErrorDb(">> Loaded 0 events. DB table `Events` is empty.");
+ return;
+ }
+
+ barGoLink bar( result->GetRowCount() );
+
+ do
+ {
+ Field *fields = result->Fetch();
+ bar.step();
+
+ uint32 event_id = fields[0].GetUInt32();
+ EventType event_type = ( EventType )fields[1].GetUInt32();
+ uint32 trigger_id = fields[2].GetUInt32();
+ uint32 trigger_cooldown = fields[3].GetUInt32();
+ uint32 start_date = fields[4].GetUInt32();
+ uint32 end_date = fields[5].GetUInt32();
+ uint32 period_ = fields[6].GetUInt32();
+ uint32 zone_id = fields[7].GetUInt32();
+ uint32 quest_id = fields[8].GetUInt32();
+ uint32 game_obj_id = fields[9].GetUInt32();
+ uint32 creature_id = fields[10].GetUInt32();
+ float x_ = fields[11].GetFloat();
+ float y_ = fields[12].GetFloat();
+ float z_ = fields[13].GetFloat();
+ float angle_ = fields[14].GetFloat();
+ TempSummonType temp_summon_type = ( TempSummonType )fields[15].GetUInt32();
+ uint32 de_spawn_time = fields[16].GetUInt32();
+ string event_message = fields[17].GetString();
+
+ switch( event_type )
+ {
+ case etSpawnCreatureByTrigger:
+ {
+ events.push_back( new SpawnCreatureByTriggerEvent( event_id, x_, y_, z_,
+ angle_, creature_id, de_spawn_time, temp_summon_type, quest_id, trigger_id, trigger_cooldown) );
+ break;
+ }
+
+ case etSpawnCreatureByDate:
+ {
+ events.push_back( new SpawnCreatureByDateEvent( event_id, x_, y_, z_,
+ angle_, creature_id, de_spawn_time, temp_summon_type, quest_id, start_date, end_date, period_, zone_id, event_message) );
+ break;
+ }
+
+ case etSpawnCreatureByGO:
+ {
+ events.push_back( new SpawnCreatureByGOEvent( event_id, x_, y_, z_,
+ angle_, creature_id, de_spawn_time, temp_summon_type, quest_id, game_obj_id ) );
+ break;
+ }
+ }
+
+ count++;
+ } while( result->NextRow() );
+
+ delete result;
+ sLog.outString( ">> Loaded %u events", count );
+ sLog.outString( "" );
+}
+
+/*=============================================================
+#The player crosses the trigger (Ивенты при пересечении тригера)
+===============================================================*/
+void EventManager::CallEventByTrigger( uint32 trigger_id, Player* player )
+{
+ for( int i = 0; i < (int)events.size(); i++ )
+ if( events[i]->GetCallEventType() == cetByTrigger && events[i]->GetTriggerId() == trigger_id )
+ events[i]->DoAction( player );
+}
+
+void SpawnCreatureByTriggerEvent::DoAction( Player* player )
+{
+ if (GetQuestId() > 0) //если в таблице есть номер квеста и он не отрицальный =)
+ {
+ if (player->GetQuestStatus(GetQuestId()) != QUEST_STATUS_NONE && player->GetQuestStatus(GetQuestId()) != QUEST_STATUS_COMPLETE)
+ {
+ if( !IsCreatureDead() )
+ return;
+
+ Creature* summoned_creature = player->SummonCreature( GetCreatureId(), GetX(), GetY(), GetZ(), GetAngle(), GetTempSummonType(), GetDeSpawnTime() );
+ if( summoned_creature )
+ AddSpawnCreature( summoned_creature );
+ }
+ }
+ else if (GetQuestId() == 0) //а если нет номера квеста то
+ {
+ if( triggerCooldown != 0 )
+ {
+ if( triggerCooldownStart != 0 && ( getMSTime() < triggerCooldownStart + triggerCooldown*1000 ) )
+ return;
+ }
+ else
+ { // слабое место если перенести этот return в начало функции
+ if( !IsCreatureDead() ) // возможен краш, т.к. память может быть уже очищена
+ return; // !- найти способ перенести в начало с коректной работой
+ }
+
+ triggerCooldownStart = getMSTime();
+ Creature* summoned_creature = player->SummonCreature( GetCreatureId(), GetX(), GetY(), GetZ(), GetAngle(), GetTempSummonType(), GetDeSpawnTime() );
+
+ if( summoned_creature )
+ AddSpawnCreature( summoned_creature );
+ }
+}
+
+/*=========================================================
+# Event by date (Ивенты при наступлении нужного дня недели)
+==========================================================*/
+void EventManager::CallEventByDate( Player* player )
+{
+ time_t cur_time = time(NULL);
+ char event_message[200] = "[EventMessager] ";
+
+ for( int i = 0; i < (int)events.size(); i++ )
+ {
+ if( events[i]->GetMessageShown() == false && cur_time+60 > events[i]->GetStartDate() && cur_time <= events[i]->GetStartDate() )
+ {
+ sWorld.SendWorldText( strcat( event_message, events[i]->GetEventMessage().c_str() ), NULL);
+ events[i]->SetMessageShown( true );
+ }
+
+ if( events[i]->GetCallEventType() == cetByDate && events[i]->GetZoneId() == player->GetZoneId() )
+ events[i]->DoAction( player );
+ }
+}
+
+void SpawnCreatureByDateEvent::DoAction( Player* player )
+{
+ if( startDate == 0 || endDate == 0 || period == 0 )
+ return;
+
+ if( startDate > endDate )
+ return;
+
+ time_t cur_time = time(NULL);
+ uint32 new_start_date = 0;
+ uint32 new_end_date = 0;
+
+ if( cur_time > startDate && cur_time < endDate )
+ {
+ if( !IsCreatureDead() )
+ return;
+
+ Creature* summoned_creature = player->SummonCreature( GetCreatureId(), GetX(), GetY(), GetZ(), GetAngle(), GetTempSummonType(), GetDeSpawnTime() );
+
+ if( summoned_creature )
+ AddSpawnCreature( summoned_creature );
+
+ new_start_date = startDate + period;
+ new_end_date = endDate + period;
+ }
+ else if( cur_time > endDate )
+ {
+ int period_count = ( cur_time - endDate )/period; //period != 0 Checks are higher!!! (если уберете проверки выше, следите за делением на 0)
+ new_start_date = startDate + ( period_count +1 )*period;
+ new_end_date = endDate + ( period_count +1 )*period;
+ }
+
+ if( new_start_date != 0 && new_end_date != 0 )
+ UpdateDate( new_start_date, new_end_date );
+}
+
+void SpawnCreatureByDateEvent::UpdateDate( uint32 new_start_date, uint32 new_end_date )
+{
+ sDatabase.PExecute( "UPDATE `Events` SET `StartDate` = FROM_UNIXTIME('%u'), `EndDate` = FROM_UNIXTIME('%u') WHERE `ZoneId` = '%u'", startDate, endDate, zoneId );
+ startDate = new_start_date;
+ endDate = new_end_date;
+ messageShown = false;
+}
+
+/*==========================================================
+# Start Event if GO is used (Ивенты при при использовании ГО)
+============================================================*/
+void EventManager::CallEventByGO( uint64 go, Player* player )
+{
+ uint32 go_id = ( uint32 )go;
+
+ for( int i = 0; i < (int)events.size(); i++ )
+ if( events[i]->GetCallEventType() == cetByGO && events[i]->GetGameObjId() == go_id )
+ events[i]->DoAction( player );
+}
+
+void SpawnCreatureByGOEvent::DoAction( Player* player )
+{
+ if (GetQuestId() > 0)
+ {
+ if (player->GetQuestStatus(GetQuestId()) != QUEST_STATUS_NONE && player->GetQuestStatus(GetQuestId()) != QUEST_STATUS_COMPLETE)
+ {
+ if( !IsCreatureDead() )
+ return;
+
+ Creature* summoned_creature = player->SummonCreature( GetCreatureId(), GetX(), GetY(), GetZ(), GetAngle(), GetTempSummonType(), GetDeSpawnTime() );
+
+ if( summoned_creature )
+ AddSpawnCreature( summoned_creature );
+ }
+ }
+ else if (GetQuestId() == 0)
+ {
+ if( !IsCreatureDead() )
+ return;
+
+ Creature* summoned_creature = player->SummonCreature( GetCreatureId(), GetX(), GetY(), GetZ(), GetAngle(), GetTempSummonType(), GetDeSpawnTime() );
+
+ if( summoned_creature )
+ AddSpawnCreature( summoned_creature );
+ }
+}
+
+/*==============================================
+# Addition (Деструкторы, дополнительные функции)
+===============================================*/
+/*SpawnCreatureEvent::~SpawnCreatureEvent()
+{
+ if( spawnedCreature )
+ delete spawnedCreature;
+}*/
+
+void SpawnCreatureEvent::AddSpawnCreature( Creature* creature )
+{
+ //if( spawnedCreature )
+ // delete spawnedCreature;
+
+ spawnedCreature = creature;
+}
+
+bool SpawnCreatureEvent::IsCreatureDead() const
+{
+ if( !spawnedCreature )
+ return true;
+
+ return !( spawnedCreature->isAlive() );
+}
Index: src/game/Event.h
===================================================================
--- src/game/Event.h (revision 0)
+++ src/game/Event.h (revision 0)
@@ -0,0 +1,243 @@
+/*
+ * Copyright © 2005,2006,2007,2007 MaNGOS <http://www.mangosproject.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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * ------------
+ * create by ispanec (aka Parkur) and RAMZES (aka RAMZES) for mangos
+ */
+#pragma once
+
+#include "Platform/Define.h"
+#include "Unit.h"
+#include "Player.h"
+#include "GameObject.h"
+
+#include <vector>
+
+using namespace std;
+
+enum EventType
+{
+ etSpawnCreatureByTrigger = 0,
+ etSpawnCreatureByDate = 1,
+ etSpawnCreatureByGO = 2,
+};
+
+enum CallEventType
+{
+ cetByTrigger = 0,
+ cetByDate = 1,
+ cetByGO = 2,
+};
+
+class Event
+{
+ public:
+
+ Event( uint32 event_id ) : eventId( event_id ) {}
+ ~Event() {}
+
+ virtual void DoAction( Player* player ) = 0;
+ virtual CallEventType GetCallEventType() const = 0;
+ virtual uint32 GetTriggerId() const = 0;
+ virtual uint32 GetZoneId() const = 0;
+ virtual uint32 GetStartDate() const = 0;
+ virtual uint32 GetGameObjId() const = 0;
+ virtual string GetEventMessage() const = 0;
+ virtual bool GetMessageShown() const = 0;
+ virtual void SetMessageShown( bool shown ) = 0;
+
+ private:
+
+ uint32 eventId;
+};
+
+/*---------------------------------------------
+Creature Event Classes (Классы креатур ивентов)
+---------------------------------------------*/
+
+class SpawnCreatureEvent : public Event
+{
+ public:
+
+ SpawnCreatureEvent( uint32 event_id, float x_, float y_, float z_,
+ float angle_, uint32 creature_id, uint32 de_spawn_time,
+ TempSummonType temp_summon_type, uint32 quest_id ) :
+ Event( event_id ), x( x_ ), y( y_ ), z( z_ ), angle( angle_ ),
+ creatureId( creature_id ), deSpawnTime( de_spawn_time ), tempSummonType( temp_summon_type ),
+ questId(quest_id), spawnedCreature( NULL ) {}
+ ~SpawnCreatureEvent() {};
+
+ uint32 GetCreatureId() const { return creatureId; }
+ float GetX() const { return x; }
+ float GetY() const { return y; }
+ float GetZ() const { return z; }
+ float GetAngle() const { return angle; }
+ uint32 GetDeSpawnTime() const { return deSpawnTime; }
+ TempSummonType GetTempSummonType() const { return tempSummonType; }
+ uint32 GetQuestId() const { return questId; }
+ void AddSpawnCreature( Creature* creature );
+ bool IsCreatureDead() const;
+
+ private:
+
+ float x, y, z, angle;
+ uint32 creatureId;
+ uint32 deSpawnTime;
+ TempSummonType tempSummonType;
+ Creature* spawnedCreature;
+ uint32 questId;
+};
+
+class SpawnCreatureByTriggerEvent : public SpawnCreatureEvent
+{
+ public:
+
+ SpawnCreatureByTriggerEvent( uint32 event_id, float x_, float y_, float z_,
+ float angle_, uint32 creature_id, uint32 de_spawn_time,
+ TempSummonType temp_summon_type, uint32 quest_id,
+ uint32 trigger_id, uint32 trigger_cooldown ) :
+ SpawnCreatureEvent( event_id, x_, y_, z_, angle_, creature_id,
+ de_spawn_time, temp_summon_type, quest_id), triggerId(trigger_id),
+ triggerCooldown ( trigger_cooldown ), triggerCooldownStart ( 0 ) {}
+ ~SpawnCreatureByTriggerEvent() {}
+
+ virtual void DoAction( Player* player );
+ virtual CallEventType GetCallEventType() const { return cetByTrigger; }
+ virtual uint32 GetTriggerId() const { return triggerId; }
+ virtual uint32 GetZoneId() const { return 0; }
+ virtual uint32 GetGameObjId() const { return 0; }
+ virtual uint32 GetStartDate() const { return 0; }
+ virtual string GetEventMessage() const { return ""; }
+ virtual bool GetMessageShown() const { return false; }
+ virtual void SetMessageShown( bool ) {}
+
+ private:
+
+ uint32 triggerId;
+ uint32 triggerCooldown;
+ uint32 triggerCooldownStart;
+};
+
+class SpawnCreatureByDateEvent : public SpawnCreatureEvent
+{
+ public:
+
+ SpawnCreatureByDateEvent( uint32 event_id, float x_, float y_, float z_,
+ float angle_, uint32 creature_id, uint32 de_spawn_time,
+ TempSummonType temp_summon_type, uint32 quest_id,
+ uint32 start_date, uint32 end_date, uint32 period_, uint32 zone_id,
+ string event_message ) :
+ SpawnCreatureEvent( event_id, x_, y_, z_, angle_, creature_id,
+ de_spawn_time, temp_summon_type, quest_id),
+ startDate( start_date ), endDate( end_date ), period( period_ ),
+ zoneId( zone_id ), eventMessage( event_message ), messageShown( false ) {}
+ ~SpawnCreatureByDateEvent() {}
+
+ virtual void DoAction( Player* player );
+ virtual CallEventType GetCallEventType() const { return cetByDate; }
+ virtual uint32 GetGameObjId() const { return 0; }
+ virtual uint32 GetTriggerId() const { return 0; }
+ virtual uint32 GetZoneId() const { return zoneId; }
+ virtual uint32 GetStartDate() const { return startDate; }
+ virtual string GetEventMessage() const { return eventMessage; }
+ virtual bool GetMessageShown() const { return messageShown; }
+ virtual void SetMessageShown( bool shown ) { messageShown = shown; }
+
+ void UpdateDate( uint32 new_start_date, uint32 new_end_date );
+
+ private:
+
+ bool messageShown;
+ uint32 startDate;
+ uint32 endDate;
+ uint32 period;
+ uint32 zoneId;
+ string eventMessage;
+};
+
+class SpawnCreatureByGOEvent : public SpawnCreatureEvent
+{
+ public:
+
+ SpawnCreatureByGOEvent( uint32 event_id, float x_, float y_, float z_,
+ float angle_, uint32 creature_id, uint32 de_spawn_time,
+ TempSummonType temp_summon_type, uint32 quest_id,
+ uint32 game_obj_id ) : SpawnCreatureEvent( event_id,
+ x_, y_, z_, angle_, creature_id, de_spawn_time,
+ temp_summon_type, quest_id ), gameObjId( game_obj_id ) {}
+ ~SpawnCreatureByGOEvent() {}
+
+ virtual void DoAction ( Player* player );
+ virtual CallEventType GetCallEventType() const { return cetByGO; }
+ virtual uint32 GetGameObjId() const { return gameObjId; }
+ virtual uint32 GetTriggerId() const { return 0; }
+ virtual uint32 GetZoneId() const { return 0; }
+ virtual uint32 GetStartDate() const { return 0; }
+ virtual string GetEventMessage() const { return ""; }
+ virtual bool GetMessageShown() const { return false; }
+ virtual void SetMessageShown( bool ) {}
+
+ private:
+
+ uint32 gameObjId;
+};
+
+class EventManager
+{
+ public:
+
+ ~EventManager();
+
+ static EventManager& Instance();
+ void LoadFromDB();
+ void CallEventByTrigger( uint32 trigger_id, Player* player );
+ void CallEventByDate( Player* player );
+ void CallEventByGO( uint64 go, Player* player );
+
+ protected:
+
+ EventManager() {}
+
+ private:
+
+ vector< Event* > events;
+};
+
+/*------------------------------------------
+GameObject Event Classes (Классы ГО ивентов)
+------------------------------------------*/
+
+class SpawnGOEvent : public Event
+{
+ public:
+
+ SpawnGOEvent( uint32 event_id, float x_, float y_, float z_,
+ float angle_, uint32 game_obj_id ) :
+ Event( event_id ), x( x_ ), y( y_ ), z( z_ ), angle( angle_ ),
+ gameObjId( game_obj_id ) {}
+ ~SpawnGOEvent() {};
+
+ uint32 GetGameObjId() const { return gameObjId; }
+ float GetX() const { return x; }
+ float GetY() const { return y; }
+ float GetZ() const { return z; }
+ float GetAngle() const { return angle; }
+
+ private:
+
+ float x, y, z, angle;
+ uint32 gameObjId;
+};
\ No newline at end of file
Index: src/game/LootHandler.cpp
===================================================================
--- src/game/LootHandler.cpp (revision 4531)
+++ src/game/LootHandler.cpp (working copy)
@@ -26,6 +26,7 @@
#include "Object.h"
#include "Group.h"
#include "World.h"
+//#include "Event.h"
void WorldSession::HandleAutostoreLootItemOpcode( WorldPacket & recv_data )
{
@@ -43,6 +44,9 @@
{
GameObject *go =
ObjectAccessor::Instance().GetGameObject(*player, lguid);
+
+ // Сall event by GO (Вызов ивента при луте ГО)
+ // EventManager::Instance().CallEventByGO( go, GetPlayer() );
// not check distance for GO in case owned GO (fishing bobber case, for example)
if (!go || go->GetOwnerGUID() != _player->GetGUID() && !go->IsWithinDistInMap(_player,INTERACTION_DISTANCE))
Index: src/game/MiscHandler.cpp
===================================================================
--- src/game/MiscHandler.cpp (revision 4531)
+++ src/game/MiscHandler.cpp (working copy)
@@ -39,6 +39,7 @@
#include "BattleGround.h"
#include "SpellAuras.h"
#include "Pet.h"
+#include "Event.h"
void WorldSession::HandleRepopRequestOpcode( WorldPacket & /*recv_data*/ )
{
@@ -457,6 +458,9 @@
GetPlayer()->SendInitWorldStates(); // only if really enters to new zone, not just area change, works strange...
GetPlayer()->UpdateZone(newZone);
+
+ //Call event by date (Вызов ивентов начинающихся по дате)
+ EventManager::Instance().CallEventByDate( GetPlayer() );
}
void WorldSession::HandleSetTargetOpcode( WorldPacket & recv_data )
@@ -920,6 +924,9 @@
}
}
}
+
+ //Call event by trigger (Вызов ивента при пересечении игроком тригера)
+ EventManager::Instance().CallEventByTrigger( Trigger_ID, GetPlayer() );
}
void WorldSession::HandleUpdateAccountData(WorldPacket &/*recv_data*/)
Index: src/game/ObjectMgr.cpp
===================================================================
--- src/game/ObjectMgr.cpp (revision 4531)
+++ src/game/ObjectMgr.cpp (working copy)
@@ -35,6 +35,7 @@
#include "Language.h"
#include "GameEvent.h"
#include "Spell.h"
+#include "Event.h"
INSTANTIATE_SINGLETON_1(ObjectMgr);
@@ -892,6 +893,12 @@
sLog.outString();
}
+//Load events from DB (Загрузка ивентов)
+void ObjectMgr::LoadEvents()
+{
+ EventManager::Instance().LoadFromDB();
+}
+
void ObjectMgr::LoadAuctionItems()
{
QueryResult *result = sDatabase.Query( "SELECT `itemguid`,`item_template` FROM `auctionhouse`" );
Index: src/game/ObjectMgr.h
===================================================================
--- src/game/ObjectMgr.h (revision 4531)
+++ src/game/ObjectMgr.h (working copy)
@@ -424,6 +424,9 @@
void CleanupInstances();
void PackInstances();
+ //event system
+ void LoadEvents();
+
//load first auction items, because of check if item exists, when loading
void LoadAuctionItems();
void LoadAuctions();
Index: src/game/SpellHandler.cpp
===================================================================
--- src/game/SpellHandler.cpp (revision 4531)
+++ src/game/SpellHandler.cpp (working copy)
@@ -29,6 +29,7 @@
#include "BattleGroundWS.h"
#include "MapManager.h"
#include "ScriptCalls.h"
+#include "Event.h"
void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
{
@@ -645,6 +646,9 @@
Spell *spell = new Spell(_player, spellInfo, false, 0);
spell->prepare(&targets);
+
+ // Сall event by GO (Вызов ивента при открытии ГО)
+ EventManager::Instance().CallEventByGO( targets.getGOTargetGUID(), _player );
}
void WorldSession::HandleCancelCastOpcode(WorldPacket& recvPacket)
Index: src/game/World.cpp
===================================================================
--- src/game/World.cpp (revision 4531)
+++ src/game/World.cpp (working copy)
@@ -611,6 +611,10 @@
sLog.outString( "Loading Item Random Enchantments Table..." );
LoadRandomEnchantmentsTable();
+
+ //Load events (загрузка ивентов)
+ sLog.outString( "Loading events..." );
+ objmgr.LoadEvents();
///- Load dynamic data tables from the database
sLog.outString( "Loading Auctions..." );
Index: win/VC71/game.vcproj
===================================================================
--- win/VC71/game.vcproj (revision 4531)
+++ win/VC71/game.vcproj (working copy)
@@ -245,6 +245,12 @@
RelativePath="..\..\src\game\DuelHandler.cpp">
</File>
<File
+ RelativePath="..\..\src\game\Event.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\game\Event.h">
+ </File>
+ <File
RelativePath="..\..\src\game\GameEvent.cpp">
</File>
<File
SQL в Базу
Код:
TABLE IF EXISTS `Events`;
CREATE TABLE `Events`
(
`EventId` int(11) NOT NULL auto_increment,
`EventType` int(11) NOT NULL default '0',
`TriggerId` int(11) NOT NULL default '0',
`TriggerCooldown` int(11) NOT NULL default '0',
`StartDate` timestamp NOT NULL default '0000-00-00 00:00:00',
`EndDate` timestamp NOT NULL default '0000-00-00 00:00:00',
`Period` int(11) NOT NULL default '0',
`ZoneId` int(11) NOT NULL default '0',
`QuestId` int(11) NOT NULL default '0',
`GameObjId` int(11) NOT NULL default '0',
`CreatureId` int(11) NOT NULL default '0',
`X` float NOT NULL default '0',
`Y` float NOT NULL default '0',
`Z` float NOT NULL default '0',
`Angle` float NOT NULL default '0',
`SpwType` tinyint(1) NOT NULL default '0',
`DespwTime` int(11) NOT NULL default '0',
`Message` char(50) NOT NULL default '',
PRIMARY KEY (`EventId` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
/*
-- for Event_0.36
ALTER TABLE `Events`
ADD COLUMN `GameObjId` INT(11) NOT NULL default '0' AFTER `ZoneId`;
*/
/*
-- for Event_0.37
ALTER TABLE `Events`
ADD COLUMN `Message` char(50) NOT NULL default'' AFTER `DespwTime`;
*/
/*
-- for Event_0.40
ALTER TABLE `Events`
ADD COLUMN `QuestId` INT(11) NOT NULL default '0' AFTER `ZoneId`;
*/
------------------------------------------------------------------------------------------
1. Описаны базовые классы
2. Описан класс SpawnCreatureByTriggerEvent (ивенты связанные со спавном кретур, по прохождению игроком тригера)
2.1 Повторный спавн через промежуток времени при повторном пересечении тригера (задается в поле TriggerCooldown)
2.2 Если TriggerCooldown = 0, то спавн креатур(ы) происходит сразу при повторном пересечении тригера (при условии смерти креатуры отспавненой до этого)
2.3 На один тригер можно вешать сколько угодно креатур и разными значениями TriggerCooldown для них (считаются разными событиями)
3. Описан класс SpawnCreatureByDateEvent (ивенты связанные со спавном кретур, по датам)
3.1 Ивент начинается в указанный промежуток времени StartDate и EndDate, если игроки не попали в указаный срок, будут ждать следующего старта.
3.2 Вызов происходит при обнововлении зоны, частоты обновления зон достаточно (по моим тестам) чтобы не волноваться о загрузке грида заранее.
3.3 Посылается сообщение перед стартом ивента, текст сообщения указывется в поле Message в таблице Events.
4. Описан класс SpawnCreatureByGOEvent (ивенты связанные со спавном кретур, при использовании ГО)
4.1 Вызов ивента пока стоит не там где нада, срабатывает при взятии лута
---------
Замечания:
- использовал код явно краша не вызывающего, возможный краш при выгрузке грида с начавшимся ивентом...
Со всем полями вроде все ясно,
SpwType - выбираем согласно:
Код:
1 - despawns after a specified time OR when the creature disappears
2 - despawns after a specified time OR when the creature dies
3 - despawns after a specified time
4 - despawns after a specified time after the creature is out of combat
5 - despawns instantly after death
6 - despawns after a specified time after death
7 - despawns when the creature disappears
8 - despawns when UnSummon() is called
EventType - выбираем согласно:
Код:
0 - spawn creature by trigger event
1 - spawn creature by date event
2 - spawn creature by gameobject event
Добавлено (23.04.2009, 14:44)
---------------------------------------------
убераем баннер при входе в игру Ответить с цитатой
http://depositfiles.com/files/wropk8brr
применяем к сорцам, на реве 2253 работает
Добавлено (23.04.2009, 14:49)
---------------------------------------------
Фиксы на кочки:
-Cobalt Deposit
-Rich Cobalt Deposit
-Saronite Deposit
-Rich Saronite Deposit
-Titanium Vein
Скачать файл mining node.sql
http://ascentfamily.ru/loc.php?url=http://dump.ru/file/1480215
Добавлено (23.04.2009, 14:51)
---------------------------------------------
[Lua] 100% Working Boss Script
This was a script that I made for a server that I develop (WowImpulse) around 3 weeks ago, but I have decided to share it with the members of MMOwned.
This boss is quite complex, it consists basically of the 8 managable classes ( Excluded hunter for obvious reasons ) that can be picked randomly by the script througout the fight; This makes the Boss 100% Random - Even the text it displays is randomised to add an element of enjoyment!
This boss may be overpowered for some servers as the server I made it for had custom gear that was equal to having a level 80-90, so it's up to you to find out!
The script is 100% working successfully and there are no errors. If you DO get errors, it's to do with how you have edited it, and post the error here. I will help you fix it.
[[Onto the script:]]
Код:
--Credits to Nymphx of MMOwned, Wowimpulse Developer--
function NPCNAME_OnEnterCombat(pUnit,Event)
pUnit:SendChatMessage(12, 0, "Ha, you actually think that puny, weak gypsys like you can even affect an immortal such as myself? I am Omniscient!")
pUnit:SendChatMessage(14, 0, "Trust me, you stand no chance against my full power!")
pUnit:RegisterEvent("NPCNAME_ClassPick", 5000, 0)
pUnit:RegisterEvent("NPCNAME_Talk", 10000, 0)
pUnit:CastSpell(20217)
pUnit:CastSpell(23948)
end
-- Random talk, 1-4 every ?? seconds.--
function NPCNAME_Talk(pUnit, Event)
Choice=math.random(1, 4)
if Choice==1 then
pUnit:SendChatMessage(14, 0, "You try so hard, yet fail so much...")
end
if Choice==2 then
pUnit:SendChatMessage(14, 0, "Your attacks do nothing to me! I am an immortal!")
end
if Choice==3 then
pUnit:SendChatMessage(14, 0, "Oh, how I wish you actually tried!")
end
if Choice==4 then
pUnit:SendChatMessage(14, 0, "You have one class, I have a choice of 8 classes at any moment. Who do YOU think will triumph?")
end
end
function NPCNAME_TalkShaman(pUnit, Event)
Choice=math.random(1, 2)
if Choice==1 then
pUnit:SendChatMessage(12, 0, "Ah Shamans, guardians of Thunder and Lightning!")
end
if Choice==2 then
pUnit:SendChatMessage(12, 0, "The elements run strong in the Shaman class...")
end
end
function NPCNAME_TalkPaladin(pUnit, Event)
Choice=math.random(1, 2)
if Choice==1 then
pUnit:SendChatMessage(12, 0, "Ah Paladins, guardians of the Holy powers and the true defenders of the Alliance.")
end
if Choice==2 then
pUnit:SendChatMessage(12, 0, "The Holy Power runs strong in the Paladin class...")
end
end
function NPCNAME_TalkDruid(pUnit, Event)
Choice=math.random(1, 2)
if Choice==1 then
pUnit:SendChatMessage(12, 0, "Ah Druids, guardians of Nature and all things living.")
end
if Choice==2 then
pUnit:SendChatMessage(12, 0, "The Natural Forces run strong in the Druid class...")
end
end
function NPCNAME_TalkPriest(pUnit, Event)
Choice=math.random(1, 2)
if Choice==1 then
pUnit:SendChatMessage(12, 0, "Ah Priests, Masters of the Holy power and Spiritual Focus.")
end
if Choice==2 then
pUnit:SendChatMessage(12, 0, "The Priest Class makes me feel alive!")
end
end
function NPCNAME_TalkRogue(pUnit, Event)
Choice=math.random(1, 2)
if Choice==1 then
pUnit:SendChatMessage(12, 0, "Ah Rogues, masters of Subtley and Hidden Movement.")
end
if Choice==2 then
pUnit:SendChatMessage(12, 0, "The Rogue Class brings me new opportinities...")
end
end
function NPCNAME_TalkWarrior(pUnit, Event)
Choice=math.random(1, 2)
if Choice==1 then
pUnit:SendChatMessage(12, 0, "Ah Warriors, fearful tanks, body inpenetrable!")
end
if Choice==2 then
pUnit:SendChatMessage(12, 0, "The might of the Warrior, feel it!")
end
end
function NPCNAME_TalkWarlock(pUnit, Event)
Choice=math.random(1, 2)
if Choice==1 then
pUnit:SendChatMessage(12, 0, "Ah Warlocks, guardians of Dark magic and hidden secrets.")
end
if Choice==2 then
pUnit:SendChatMessage(12, 0, "The shadows that surround the Warlock Class will always remain a mystery...")
end
end
--credits to nymphx of mmowned--
function NPCNAME_TalkMage(pUnit, Event)
Choice=math.random(1, 2)
if Choice==1 then
pUnit:SendChatMessage(12, 0, "Ah Mages, guardians of the 3 Magic fields: Frost, Fire and Arcane.")
end
if Choice==2 then
pUnit:SendChatMessage(12, 0, "The Mage class is very versatile, I may use this again sometime...")
end
end
-- This picks the class, random 1-8, can be the same class again if unlucky. Varys the fight. --
function NPCNAME_ClassPick(pUnit, Event)
pUnit:RemoveEvents()
Choice=math.random(1, 8)
if Choice==1 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Shaman!")
pUnit:RegisterEvent("NPCNAME_Shaman", 1000, 0)
pUnit:CastSpellOnTarget(34353,pUnit:GetRandomPlayer(0))
end
if Choice==2 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Paladin!")
pUnit:RegisterEvent("NPCNAME_Paladin", 1000, 0)
pUnit:CastSpellOnTarget(27174,pUnit:GetRandomPlayer(0))
end
if Choice==3 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Druid!")
pUnit:RegisterEvent("NPCNAME_Druid", 1000, 0)
pUnit:CastSpell(33763)
pUnit:CastSpell(33763)
pUnit:CastSpell(33763)
end
if Choice==4 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Priest!")
pUnit:RegisterEvent("NPCNAME_Priest", 1000, 0)
pUnit:CastSpellOnTarget(25364,pUnit:GetRandomPlayer(0))
end
if Choice==5 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Rogue!")
pUnit:RegisterEvent("NPCNAME_Rogue", 1000, 0)
pUnit:CastSpellOnTarget(36554,pUnit:GetRandomPlayer(0))
pUnit:CastSpell(43547)
end
if Choice==6 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Warrior!")
pUnit:RegisterEvent("NPCNAME_Warrior", 1000, 0)
pUnit:CastSpellOnTarget(25264,pUnit:GetMainTank())
end
if Choice==7 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Warlock!")
pUnit:RegisterEvent("NPCNAME_Warlock", 1000, 0)
pUnit:CastSpell(27212)
end
if Choice==8 then
pUnit:SendChatMessage(14, 0, "Feel the power of the Mage!")
pUnit:RegisterEvent("NPCNAME_Mage", 1000, 0)
pUnit:CastSpellOnTarget(6131,pUnit:GetMainTank())
end
end
--SHAMAN OPTION 1--
function NPCNAME_Shaman(pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("NPCNAME_SpellShamanChain", 11000, 0) --16033--
pUnit:RegisterEvent("NPCNAME_SpellShamanEarth", 13000, 0) --47071--
pUnit:RegisterEvent("NPCNAME_SpellShamanFrost", 14000, 0) --34353--
pUnit:RegisterEvent("NPCNAME_SpellShamanBuff", 5000, 0) --57802--
pUnit:SetModel(20681)
pUnit:SetScale(2)
pUnit:RegisterEvent("NPCNAME_ClassPick", 30000, 0)
pUnit:RegisterEvent("NPCNAME_TalkShaman", 15000, 0)
pUnit:RegisterEvent("NPCNAME_Talk", 10000, 0)
end
function NPCNAME_SpellShamanChain(pUnit,Event)
pUnit:CastSpellOnTarget(16033,pUnit:GetMainTank())
end
function NPCNAME_SpellShamanEarth(pUnit,Event)
pUnit:CastSpellOnTarget(47071,pUnit:GetRandomPlayer(0))
end
function NPCNAME_SpellShamanFrost(pUnit,Event)
pUnit:CastSpellOnTarget(34353,pUnit:GetRandomPlayer(0))
end
function NPCNAME_SpellShamanBuff(pUnit,Event)
pUnit:CastSpell(49284)
end
--PALADIN OPTION 2--
function NPCNAME_Paladin(pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("NPCNAME_SpellPaladinCons", 10000, 0) --27173--
pUnit:RegisterEvent("NPCNAME_SpellPaladinReckoning", 13500, 0) --20178--
pUnit:RegisterEvent("NPCNAME_SpellPaladinSeal", 30000, 0) --31801--
pUnit:RegisterEvent("NPCNAME_SpellPaladinShock", 15000, 0) --27174--
pUnit:RegisterEvent("NPCNAME_SpellPaladinShield", 12000, 0) --642--
pUnit:SetModel(6198)
pUnit:SetScale(2)
pUnit:RegisterEvent("NPCNAME_ClassPick", 30000, 0)
pUnit:RegisterEvent("NPCNAME_TalkPaladin", 15000, 0)
pUnit:RegisterEvent("NPCNAME_Talk", 10000, 0)
end
function NPCNAME_SpellPaladinCons(pUnit,Event)
pUnit:CastSpell(27173)
end
function NPCNAME_SpellPaladinReckoning(pUnit,Event)
pUnit:CastSpell(20178)
end
function NPCNAME_SpellPaladinSeal(pUnit,Event)
pUnit:CastSpell(31801)
end
function NPCNAME_SpellPaladinShock(pUnit,Event)
pUnit:CastSpellOnTarget(27174,pUnit:GetRandomPlayer(0))
end
function NPCNAME_SpellPaladinShield(pUnit,Event)
pUnit:CastSpell(642)
end
--DRUID OPTION 3--
function NPCNAME_Druid(pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("NPCNAME_SpellDruidStarfire", 10000, 0) --26986--
pUnit:RegisterEvent("NPCNAME_SpellDruidCripple", 12000, 0) --20812--
pUnit:RegisterEvent("NPCNAME_SpellDruidLifebloom", 7000, 0) --33763--
pUnit:RegisterEvent("NPCNAME_SpellDruidNatures", 19000, 0) --27009--
pUnit:SetModel(5927)
pUnit:RegisterEvent("NPCNAME_ClassPick", 30000, 0)
pUnit:RegisterEvent("NPCNAME_TalkDruid", 15000, 0)
pUnit:RegisterEvent("NPCNAME_Talk", 10000, 0)
end
function NPCNAME_SpellDruidStarfire(pUnit,Event)
pUnit:CastSpellOnTarget(26986,pUnit:GetMainTank())
end
function NPCNAME_SpellDruidCripple(pUnit,Event)
pUnit:CastSpellOnTarget(20812,pUnit:GetRandomPlayer(0))
end
function NPCNAME_SpellDruidLifebloom(pUnit,Event)
pUnit:CastSpell(33763)
pUnit:CastSpell(33763)
pUnit:CastSpell(33763)
end
function NPCNAME_SpellDruidNatures(pUnit,Event)
pUnit:CastSpell(27009)
end
--PRIEST OPTION 4--
function NPCNAME_Priest(pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("NPCNAME_SpellPriestNova", 8000, 0) --48078--
pUnit:RegisterEvent("NPCNAME_SpellPriestSmite", 10000, 0) --25364--
pUnit:RegisterEvent("NPCNAME_SpellPriestDispel", 19000, 0) --32375--
pUnit:RegisterEvent("NPCNAME_SpellPriestPain", 15000, 0) --25368--
pUnit:SetModel(5072)
pUnit:SetScale(1)
pUnit:RegisterEvent("NPCNAME_ClassPick", 30000, 0)
pUnit:RegisterEvent("NPCNAME_TalkPriest", 15000, 0)
pUnit:RegisterEvent("NPCNAME_Talk", 10000, 0)
end
function NPCNAME_SpellPriestNova(pUnit,Event)
pUnit:CastSpellOnTarget(48078,pUnit:GetMainTank())
end
--credits to nymphx of mmowned--
function NPCNAME_SpellPriestSmite(pUnit,Event)
pUnit:CastSpellOnTarget(25364,pUnit:GetRandomPlayer(0))
end
function NPCNAME_SpellPriestDispel(pUnit,Event)
pUnit:CastSpell(32375)
end
function NPCNAME_SpellPriestPain(pUnit,Event)
pUnit:CastSpellOnTarget(25368,pUnit:GetRandomPlayer(0))
pUnit:CastSpellOnTarget(25368,pUnit:GetMainTa nk())
end
--ROGUE OPTION 5--
function NPCNAME_Rogue(pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("NPCNAME_SpellRogueBlind", 11000, 0) --2094--
pUnit:RegisterEvent("NPCNAME_SpellRogueGhostly", 6000, 0) --14278--
pUnit:RegisterEvent("NPCNAME_SpellRogueSStep", 15000, 0) --36554--
pUnit:SetModel(3618)
pUnit:SetScale(2)
pUnit:RegisterEvent("NPCNAME_ClassPick", 30000, 0)
pUnit:RegisterEvent("NPCNAME_TalkRogue", 15000, 0)
pUnit:RegisterEvent("NPCNAME_Talk", 10000, 0)
end
--credits to nymphx of mmowned--
function NPCNAME_SpellRogueBlind(pUnit,Event)
pUnit:CastSpellOnTarget(2094,pUnit:GetRandomPlayer(0))
end
function NPCNAME_SpellRogueGhostly(pUnit,Event)
pUnit:CastSpellOnTarget(14278,pUnit:GetMainTank())
end
function NPCNAME_SpellRogueSStep(pUnit,Event)
pUnit:CastSpellOnTarget(36554,pUnit:GetRandomPlayer(0))
end
--WARRIOR OPTION 6--
function NPCNAME_Warrior(pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("NPCNAME_SpellWarriorClap", 15000, 0) --25264--
pUnit:RegisterEvent("NPCNAME_SpellWarriorRend", 9000, 0) --25208--
pUnit:RegisterEvent("NPCNAME_SpellWarriorMortal", 13000, 0) --30330--
pUnit:RegisterEvent("NPCNAME_SpellWarriorCharge", 16000, 0) --11578--
pUnit:SetModel(19536)
pUnit:SetScale(2)
pUnit:RegisterEvent("NPCNAME_ClassPick", 30000, 0)
pUnit:RegisterEvent("NPCNAME_TalkWarrior", 15000, 0)
pUnit:RegisterEvent("NPCNAME_Talk", 10000, 0)
end
function NPCNAME_SpellWarriorClap(pUnit,Event)
pUnit:CastSpellOnTarget(25264,pUnit:GetMainTank())
end
function NPCNAME_SpellWarriorRend(pUnit,Event)
pUnit:CastSpellOnTarget(25208,pUnit:GetMainTank())
end
function NPCNAME_SpellWarriorMortal(pUnit,Event)
pUnit:CastSpellOnTarget(30330,pUnit:GetMainTank())
end
function NPCNAME_SpellWarriorCharge(pUnit,Event)
pUnit:CastSpellOnTarget(11578,pUnit:GetRandomPlayer(0))
end
--WARLOCK OPTION 7--
function NPCNAME_Warlock(pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("NPCNAME_SpellWarlockRain", 16000, 0) --27212--
pUnit:RegisterEvent("NPCNAME_SpellWarlockAgony", 10000, 0) --11712--
pUnit:RegisterEvent("NPCNAME_SpellWarlockIdiocy", 9000, 0) --1010--
pUnit:RegisterEvent("NPCNAME_SpellWarlockCoil", 11000, 0) --17926--
pUnit:SetModel(4462)
pUnit:SetScale(2)
pUnit:RegisterEvent("NPCNAME_ClassPick", 30000, 0)
pUnit:RegisterEvent("NPCNAME_TalkWarlock", 15000, 0)
pUnit:RegisterEvent("NPCNAME_Talk", 10000, 0)
end
--credits to nymphx of mmowned--
function NPCNAME_SpellWarlockRain(pUnit,Event)
pUnit:CastSpell(27212)
end
function NPCNAME_SpellWarlockAgony(pUnit,Event)
pUnit:CastSpellOnTarget(11712,pUnit:GetRandomPlayer(0))
end
function NPCNAME_SpellWarlockIdiocy(pUnit,Event)
pUnit:CastSpellOnTarget(1010,pUnit:GetRandomPlayer(0))
end
function NPCNAME_SpellWarlockCoil(pUnit,Event)
pUnit:CastSpellOnTarget(17926,pUnit:GetRandomPlayer(0))
end
--MAGE OPTION 8--
function NPCNAME_Mage(pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("NPCNAME_SpellMageExplosion", 10000, 0) --27082--
pUnit:RegisterEvent("NPCNAME_SpellMageCone", 15000, 0) --10161--
pUnit:RegisterEvent("NPCNAME_SpellMageNova", 12000, 0) --6131--
pUnit:RegisterEvent("NPCNAME_SpellMageLance", 8000, 0) --30455--
pUnit:SetModel(1484)
pUnit:SetScale(2)
pUnit:RegisterEvent("NPCNAME_ClassPick", 30000, 0)
pUnit:RegisterEvent("NPCNAME_TalkMage", 15000, 0)
pUnit:RegisterEvent("NPCNAME_Talk", 10000, 0)
end
--credits to nymphx of mmowned--
function NPCNAME_SpellMageExplosion(pUnit,Event)
pUnit:CastSpell(27082)
end
function NPCNAME_SpellMageCone(pUnit,Event)
pUnit:CastSpellOnTarget(10161,pUnit:GetMainTank())
end
function NPCNAME_SpellMageNova(pUnit,Event)
pUnit:CastSpellOnTarget(6131,pUnit:GetMainTank())
end
function NPCNAME_SpellMageLance(pUnit,Event)
pUnit:CastSpellOnTarget(30455,pUnit:GetRandomPlayer(0))
end
--Rest of Script--
function NPCNAME_OnLeaveCombat(pUnit, event)
pUnit:RemoveEvents()
end
function NPCNAME_OnKilledTarget(pUnit)
pUnit:SendChatMessage(12, 0, "Feel my Wrath!")
pUnit:PlaySoundToSet(9250)
end
function NPCNAME_Death(pUnit)
pUnit:SendChatMessage(14, 0, "H...How can it be? I have nothing to say to you...")
pUnit:SendChatMessage(12, 0, "Boss Made By Nymphs, WoWImpulse Developer/Gm")
pUnit:RemoveEvents()
end
RegisterUnitEvent(NPCID, 1, "NPCNAME_OnEnterCombat")
RegisterUnitEvent(NPCID, 2, "NPCNAME_OnLeaveCombat")
RegisterUnitEvent(NPCID, 3, "NPCNAME_OnKilledTarget")
RegisterUnitEvent(NPCID, 4, "NPCNAME_Death")
Please take time to read through the script and understand it's logistics and the way it works.
If you have ANY tips on how to improve this script/Thread, or want to add in your thoughts, feel free to leave a post.
Добавлено (23.04.2009, 14:52)
---------------------------------------------
Sun++:
офф. сайт: http://sunplusplus.info/
SVN: http://svn.assembla.com/svn/sunplusplus/Trunk/
мануал: нет
Добавлено (23.04.2009, 14:52)
---------------------------------------------
модификация пвп системы
Цитата:
[codebox]
uint32 attacklvl = pPlayer->getLevel();
uint32 killedlvl = static_cast< Player* pVictim )->getLevel();
uint32 diff = -1;
bool ganked = false;
if (attacklvl > killedlvl)
{
diff = attacklvl-killedlvl;
if(diff >= 16)
ganked = true;
}
char message[200];
sprintf(message, "[%s]: %s[%u] has %s %s[%u]", (pPlayer->HasFlag(PLAYER_FLAGS, PLAYER_FLAG_FREE_FOR_ALL_PVP) ? "FFA" : "PvP"), pPlayer->GetName(), attacklvl, ganked ? "ganked" : "killed", static_cast< Player* pVictim )->GetName(), killedlvl);
sWorld.SendWorldWideScreenText(message);
if(!ganked)
pPlayer->GetItemInterface()->SafeAddItem(390000, INVENTORY_SLOT_NOT_SET, 23);
if(ganked && !pPlayer->HasFlag(PLAYER_FLAGS, PLAYER_FLAG_FREE_FOR_ALL_PVP) && !pPlayer->GetSession()->CanUseCommand('+'))
{
pPlayer->GetSession()->SystemMessage("You have ganked %s. You will be punished!", static_cast< Player* pVictim )->GetName());
pPlayer->KillPlayer();
pPlayer->Kick(6000);
return;
}
[/codebox]
Добавлено (23.04.2009, 14:54)
---------------------------------------------
function название_функции_OnGossip(Unit, Event, Player)
Unit:GossipCreateMenu(100, Player, 0)
Unit:GossipMenuAddItem(0, "название пункта 1", 1, 0)
Unit:GossipMenuAddItem(0, "название пункта 2", 2, 0)
Unit:GossipSendMenu(Player)
end
function название_функции_OnSelect(Unit, Event, Player, MenuId, id, Code)
if (id == 1) then
Player:Teleport(609, 2353, 5663, 382,251831) //координаты телепортации 1
Unit:GossipComplete(Player)
end
if (id == 2) then
Player:Teleport(139, 2356, 5673, 382,243835) //координаты телепортации 2
Unit:GossipComplete(Player)
end
end
RegisterUnitGossipEvent(500007, 1, "название_функции_OnGossip")
RegisterUnitGossipEvent(500007, 2, "название_функции_OnSelect")
// 500007 - номер нпс на котором будет установлен этот скрипт