Skip to content

Instantly share code, notes, and snippets.

/*
Fixed and explained Srzm's script
http://www.ac-web.org/forums/showthread.php?231858-Help-Getting-started-with-Custom-NPC-and-Boss-Scripting
I'm using Trinity Core 3.3.5 (22-march-2018 updated version)
-- ==================================================================================================================================
-- This is the npc I used in my database
Set @Entry = 55000,
@Npc_Name = "Test",
//updated
// added check for negative bets
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "WorldSession.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "Random.h"
#include "Chat.h"
@mindsear
mindsear / gameobject_example.cpp
Created March 7, 2018 15:34
latest tc 3.3.5 gameobject c++ script example
#include "ScriptedGossip.h"
#include "WorldSession.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "GameObject.h"
#include "GameObjectAI.h"
class example_go : public GameObjectScript
{
public:
-- Here you can set NPC entry, name, subname, gossip_menu_id, displayID
SET @NpcEntry := 180009;
SET @NpcName := 'Morpher';
SET @NpcSubName := '';
SET @NpcDisplayID := 30883;
SET @GossipOptionID := 50090;
SET @GOSSIP_ICON_DOT := 10; -- Yellow Dot
-- If @NpcEntry, @GossipOptionID already exists in your database, delete those entries
DELETE FROM world.gossip_menu_option WHERE MenuID = @GossipOptionID;
@mindsear
mindsear / beastmaster.sql
Created August 8, 2017 13:10
Beastmaster sql script for TrinityCore 3.3.5 (TDB 335.63) - Unfinished
-- Here you can set npc entry, name, subname, gossip_menu_id, displayID
SET @NpcEntry := 180005;
SET @NpcName := 'Beastmaster';
SET @NpcSubName := '';
SET @NpcDisplayID := 30883;
SET @GossipOptionID := 50030;
SET @GOSSIP_ICON_TRAINER := 3;
-- If @NpcEntry, @GossipOptionID already exists in your database, delete those entries
DELETE FROM world.gossip_menu_option WHERE menu_id = @GossipOptionID;
-- TC 3.3.5 unmodified playercreateinfo_spell_custom table
USE world;
DROP TABLE IF EXISTS `playercreateinfo_spell_custom`;
CREATE TABLE IF NOT EXISTS `playercreateinfo_spell_custom` (
`racemask` int(10) unsigned NOT NULL DEFAULT '0',
`classmask` int(10) unsigned NOT NULL DEFAULT '0',
`Spell` mediumint(8) unsigned NOT NULL DEFAULT '0',
`Note` varchar(255) DEFAULT NULL,
PRIMARY KEY (`racemask`,`classmask`,`Spell`)
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.1.16-MariaDB - mariadb.org binary distribution
-- Server OS: Win32
-- HeidiSQL Version: 9.4.0.5174
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
local NPCID = 9982
function On_Gossip(event, player, pUnit)
if (player:GetLevel() >= 80) then
if (player:GetClass() == 1) then -- warrior
player:GossipMenuAddItem(3,"[Costs 1000g] Learn me all my spells!",0,1)
elseif (player:GetClass() == 2) then -- paladin
player:GossipMenuAddItem(3,"[Costs 1000g] Learn me all my spells!",0,2)
elseif (player:GetClass() == 3) then -- hunter