NeWoW
|
Дата: Пятница, 13.04.2012, 22:00 | Сообщение # 1 |
Капрал
Сообщений: 36
| Взято с приват исходников arcanum-core
Quote /* * Copyright © 2008 - 2011 Trinity * * Copyright © 2006 - 2011 ScriptDev2 * * Copyright © 2011 Arcanum Core Private * * 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 */
#include "ScriptPCH.h" #include "Config.h"
#define NPC_ENTRY_TO_SUMMON 100000 #define UNSUMMON_TIME 30000
#define FROST_EMBLEM 49426 #define TRIUMPH_EMBLEM 47241
//Тут по правильному будет сделать вывод в госсип данных в зависимости от рейтов в конфиге, //но промучавшись пол часа я понял, что лучше сделаю это позже, гребаные приведения типов выводят меня из себя. #define GOSSIP_ITEM_FROST_TO_TRIUMPH "Сменить 1 эмблему льда на 5 триумфа" #define GOSSIP_ITEM_FROST_TO_TRIUMPH_10 "Сменить 10 эмблем льда на 50 триумфа" #define GOSSIP_ITEM_TRIUMPH_TO_FROST "Сменить 5 эмблем триумфа на 1 льда" #define GOSSIP_ITEM_TRIUMPH_TO_FROST_50 "Сменить 50 эмблем триумфа на 10 льда"
//uint32 triumph_for_frost_count = sWorld->getIntConfig(CONFIG_TRIUMPH_FOR_FROST_COUNT);
/* #define ITEM_COMPARE_ENTRY 12345 #define ITEM_COMPARE_COUNT 6 #define ITEM_RESULT_ENTRY 54321 #define ITEM_RESULT_COUNT 1 */
class item_custom_summon : public ItemScript { public: item_custom_summon() : ItemScript("item_custom_summon") {}
bool OnUse(Player* pPlayer, Item* pItem, SpellCastTargets const& /*targets*/) { if ((pPlayer->isInCombat()) || (pPlayer->isInFlight()) || (pPlayer->isDead())) { pPlayer->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, pItem, NULL); return false; }
if (pPlayer->IsMounted()) { pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); return false; }
pPlayer->SummonCreature(NPC_ENTRY_TO_SUMMON, pPlayer->GetPositionX()+1, pPlayer->GetPositionY(), pPlayer->GetPositionZ()+2, 0, TEMPSUMMON_TIMED_DESPAWN, UNSUMMON_TIME); return false; } };
class npc_emblem_exchanger : public CreatureScript { public: npc_emblem_exchanger() : CreatureScript("npc_emblem_exchanger") {}
bool OnGossipHello(Player* player, Creature* creature) { player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_FROST_TO_TRIUMPH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
if(player->GetItemCount(FROST_EMBLEM) >= 10) player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_FROST_TO_TRIUMPH_10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TRIUMPH_TO_FROST, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); if(player->GetItemCount(TRIUMPH_EMBLEM) >= 5*10) player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TRIUMPH_TO_FROST_50, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
player->SEND_GOSSIP_MENU(3961, creature->GetGUID()); return true; }
bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction) { if (uiAction == GOSSIP_ACTION_INFO_DEF+1) { if (player->GetItemCount(FROST_EMBLEM) >= 1) { player->DestroyItemCount(FROST_EMBLEM, 1, true, false); player->AddItem(TRIUMPH_EMBLEM, 5); } else { creature->MonsterWhisper("Недостаточно эмблем льда.", player->GetGUID()); } player->CLOSE_GOSSIP_MENU(); return true; }
if (uiAction == GOSSIP_ACTION_INFO_DEF+2) { if (player->GetItemCount(FROST_EMBLEM) >= 10) { player->DestroyItemCount(FROST_EMBLEM, 10, true, false); player->AddItem(TRIUMPH_EMBLEM, 5*10); } else { creature->MonsterWhisper("Недостаточно эмблем льда.", player->GetGUID()); } player->CLOSE_GOSSIP_MENU(); return true; }
if (uiAction == GOSSIP_ACTION_INFO_DEF+3) { if (player->GetItemCount(TRIUMPH_EMBLEM) >= 5) { player->DestroyItemCount(TRIUMPH_EMBLEM, 5, true, false); player->AddItem(FROST_EMBLEM, 1); } else { creature->MonsterWhisper("Недостаточно эмблем триумфа.", player->GetGUID()); } player->CLOSE_GOSSIP_MENU(); return true; }
if (uiAction == GOSSIP_ACTION_INFO_DEF+4) { if (player->GetItemCount(TRIUMPH_EMBLEM) >= 5*10) { player->DestroyItemCount(TRIUMPH_EMBLEM, 5*10, true, false); player->AddItem(FROST_EMBLEM, 10); } else { creature->MonsterWhisper("Недостаточно эмблем триумфа.", player->GetGUID()); } player->CLOSE_GOSSIP_MENU(); return true; }
return true; } };
/* class item_compare : public ItemScript { public: item_compare() : ItemScript("item_compare") {}
bool OnUse(Player* pPlayer, Item* pItem, SpellCastTargets const&) { if ((pPlayer->isInCombat()) || (pPlayer->isInFlight()) || (pPlayer->isDead())) { pPlayer->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, pItem, NULL); return false; }
if (pPlayer->IsMounted()) { pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); return false; }
if (pPlayer->HasItemCount(ITEM_COMPARE_ENTRY, ITEM_COMPARE_COUNT, false)) { pPlayer->DestroyItemCount(ITEM_COMPARE_ENTRY, ITEM_COMPARE_COUNT, true, false); pPlayer->AddItem(ITEM_RESULT_ENTRY, ITEM_RESULT_COUNT); }
else pPlayer->Whisper("У вас недостаточное количество вещей", LANG_UNIVERSAL, pPlayer->GetGUID());
return false; } }; */
/*UPDATE item_template SET spellid_1 = 0, spellcooldown_1 = 0, spellcategorycooldown_1 = 0, spellcategorycooldown_2 = 0, spellcategorycooldown_3 = 0, spellcategorycooldown_4 = 0, spellcategorycooldown_5 = 0, ScriptName = "hearthstone_without_cooldown" WHERE entry = 6948;
class hearthstone_without_cooldown : public ItemScript { public: hearthstone_without_cooldown() : ItemScript("hearthstone_without_cooldown") {}
bool OnUse(Player* pPlayer, Item* pItem, SpellCastTargets const&) { if ((pPlayer->isInCombat()) || (pPlayer->isInFlight()) || (pPlayer->isDead())) { pPlayer->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, pItem, NULL); return false; }
if (pPlayer->IsMounted()) { pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); return false; }
pPlayer->RemoveSpellCooldown(8690,true); pPlayer->CastSpell(pPlayer,8690,false);
return false; } }; */
/* create table `character_morphs`( `guid` int(10) UNSIGNED NOT NULL COMMENT 'Character guid', `morph` int(5) UNSIGNED NOT NULL COMMENT 'Character morph' ) Engine='Default' comment='' row_format=Default charset=utf8 collate=utf8_general_ci
class morphing_on_login : public PlayerScript { public: morphing_on_login() : PlayerScript("morphing_on_login") {}
void OnLogin(Player* player) { int64 pguid = player->GetGUID(); QueryResult morph = CharacterDatabase.PQuery("SELECT morph from character_morphs WHERE guid = '%u'", pguid); QueryResult scale = CharacterDatabase.PQuery("SELECT scale from character_morphs WHERE guid = '%u'", pguid);
if (morph) player->SetDisplayId(morph->Fetch()->GetUInt32());
if (scale) player->SetFloatValue(OBJECT_FIELD_SCALE_X, scale->Fetch()->GetFloat()); } }; */
void AddSC_item_custom_summon() { new item_custom_summon(); new npc_emblem_exchanger(); //new morphing_on_login(); //new item_compare(); //hearthstone_without_cooldown(); } Добавлено (13.04.2012, 21:57) --------------------------------------------- Обменник Эмблем нпц (Id 999997)
Quote DELETE FROM `creature_template`WHERE entry = 999997; INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Health_mod`, `Mana_mod`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES ('999997','0','0','0','0','0','7337','0','7337','0','Обменник эмблем','','','0','83','83','0','35','35','1','2','2','1','2','50','150','0','1000','1000','2000','1500','2','2','0','0','0','0','0','0','10 0','250','1000','7','2','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','1000','1000','','0','3','100','50','10' ,'0','0','0','0','0','0','0','0','1','4493','0','2','npc_emblem_exchanger','12340');
Добавлено (13.04.2012, 21:58) --------------------------------------------- Вещь призывающая телепортера (Id 8)
Quote DELETE FROM `item_template` WHERE (`entry`=8); DELETE FROM `locales_item` WHERE (`entry`=8); INSERT INTO `item_template` VALUES ('8', '13', '0', '-1', 'Summon Teleporter', '12735', '1', '64', '0', '1', '0', '0', '0', '-1', '-1', '80', '0', '0', '0', '0', '0', '0', '0', '0', '0', '20', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '18282', '0', '-1', '-1', '300000', '0', '-1', '0', '0', '0', '0', '-1', '0', '-1', '0', '0', '0', '0', '-1', '0', '-1', '0', '0', '0', '0', '-1', '0', '-1', '0', '0', '0', '0', '-1', '0', '-1', '1', 'Summons Teleporter', '0', '0', '0', '0', '0', '-1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '0', '0', '0', '0', 'item_custom_summon', '0', '0', '0', '0', '1'); INSERT INTO `locales_item`(`entry`,`name_loc1`,`name_loc2`,`name_loc3`,`name_loc4`,`name_loc5`,`name_loc6`,`name_loc7`,`name_loc8`,`description_loc1`,`d escription_loc2`,`description_loc3`,`description_loc4`,`description_loc5`,`description_loc6`,`description_loc7`,`description_loc8`) VALUES ( '8','','','','','','','','Призыв Телепортера',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Эта вещь призывает Мастера Телепортации');
Добавлено (13.04.2012, 22:00) --------------------------------------------- Сам телепортер
Думою кому нить пригодиться)))) Особенно Обмен Эмблем
Вроде бы (не факт тут еще что то но я хз) Телепортер залит на депозит так как это первая ссылка которую нашол))))
Помогаю чем могу по сборкам, патчам и в остальном)
Сообщение отредактировал NeWoW - Суббота, 14.04.2012, 04:50 |
|
| |