关灯
开启左侧

魔兽私服:物品传送脚本代码mangos-TBC

  [复制链接]
admin实名认证 发表于 2016-4-20 22:58:52 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
 
  1. diff -Nuar oregoncore-current/sql/CMakeLists.txt oregoncore-pq/sql/CMakeLists.txt
  2. --- oregoncore-current/sql/CMakeLists.txt        2011-01-01 10:03:07.000000000 -0500
  3. +++ oregoncore-pq/sql/CMakeLists.txt        2011-01-01 10:16:13.000000000 -0500
  4. @@ -1,6 +1,7 @@
  5. add_subdirectory(updates)
  6. add_subdirectory(tools)
  7. add_subdirectory(scripts)
  8. +add_subdirectory(oc-patch)

  9. ########### install files ###############
  10. diff -Nuar oregoncore-current/sql/oc-patch/CMakeLists.txt oregoncore-pq/sql/oc-patch/CMakeLists.txt
  11. --- oregoncore-current/sql/oc-patch/CMakeLists.txt        1969-12-31 19:00:00.000000000 -0500
  12. +++ oregoncore-pq/sql/oc-patch/CMakeLists.txt        2011-01-01 10:16:13.000000000 -0500
  13. @@ -0,0 +1,6 @@
  14. +
  15. +########### install files ###############
  16. +
  17. +FILE(GLOB _SQL *.sql)
  18. +
  19. +install(FILES ${_SQL} DESTINATION share/oregon/sql/oc-patch)
  20. diff -Nuar oregoncore-current/sql/oc-patch/world-itemteleport.sql oregoncore-pq/sql/oc-patch/world-itemteleport.sql
  21. --- oregoncore-current/sql/oc-patch/world-itemteleport.sql        1969-12-31 19:00:00.000000000 -0500
  22. +++ oregoncore-pq/sql/oc-patch/world-itemteleport.sql        2011-01-01 10:16:13.000000000 -0500
  23. @@ -0,0 +1,57 @@
  24. +
  25. +CREATE TABLE IF NOT EXISTS `item_teleports` (
  26. +  `entry` int(10) unsigned NOT NULL,
  27. +  `mapid` int(10) unsigned NOT NULL,
  28. +  `x_pos` float NOT NULL,
  29. +  `y_pos` float NOT NULL,
  30. +  `z_pos` float NOT NULL,
  31. +  `orientation` float NOT NULL,
  32. +  `name` varchar(30) default NULL,
  33. +  PRIMARY KEY  (`entry`)
  34. +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Optional table to create custom item portals';
  35. +
  36. +--
  37. +-- Dumping data for table `item_teleports`
  38. +--
  39. +
  40. +INSERT INTO `item_teleports` (`entry`, `mapid`, `x_pos`, `y_pos`, `z_pos`, `orientation`, `name`) VALUES
  41. +(100010, 1, 16234.7, 16308.5, 20.844, 5.3328, 'GM Island'),
  42. +(100022, 1, 9950.73, 2605.7, 1316.18, 3.72, 'Darnassus'),
  43. +(100023, 530, -3956.9, -11660.2, -138.75, 2.25, 'Exodar'),
  44. +(100024, 0, -4830.45, -1188.09, 502.46, 1.01, 'Ironforge'),
  45. +(100025, 1, 1582.05, -4418.27, 8.05, 0.38, 'Orgrimmar'),
  46. +(100026, 530, 9474.99, -7295.07, 14.31, 5.92, 'Silvermoon City'),
  47. +(100027, 0, -8843.74, 611.06, 92.76, 0.75, 'Stormwind City'),
  48. +(100021, 1, -1242.29, 71.16, 128.26, 5.96, 'Thunder Bluff'),
  49. +(100020, 0, 1581.04, 276.09, -43.1027, 6.13, 'Undercity'),
  50. +(100018, 530, -1833.9, 5371.17, -12.428, 1.92025, 'Shattrath City'),
  51. +(100011, 1, 4600.31, -3866.36, 944.185, 1.04615, 'Hyjal'),
  52. +(100012, 0, -11069, -1795, 53.7249, 2.36876, 'Karazhan Crypt'),
  53. +(100013, 1, -11372.4, -4721.3, 5.64663, 0.04398, 'Tanaris Islands'),
  54. +(100014, 0, -4845, -1082.69, 495.58, 3.08426, 'Old Ironforge'),
  55. +(100015, 0, -8644.49, 584.137, 95.6914, 1.87553, 'Stormwind Prison'),
  56. +(100016, 0, -4033.44, -1464.35, 169.863, 1.16318, 'Wetlands Farm');
  57. +
  58. +--
  59. +-- Dumping data for table `item_template`
  60. +--
  61. +
  62. +INSERT INTO `item_template` (`entry`, `class`, `subclass`, `unk0`, `name`, `displayid`, `Quality`, `Flags`, `BuyCount`, `BuyPrice`, `SellPrice`, `InventoryType`, `AllowableClass`, `AllowableRace`, `ItemLevel`, `RequiredLevel`, `RequiredSkill`, `RequiredSkillRank`, `requiredspell`, `requiredhonorrank`, `RequiredCityRank`, `RequiredReputationFaction`, `RequiredReputationRank`, `maxcount`, `stackable`, `ContainerSlots`, `stat_type1`, `stat_value1`, `stat_type2`, `stat_value2`, `stat_type3`, `stat_value3`, `stat_type4`, `stat_value4`, `stat_type5`, `stat_value5`, `stat_type6`, `stat_value6`, `stat_type7`, `stat_value7`, `stat_type8`, `stat_value8`, `stat_type9`, `stat_value9`, `stat_type10`, `stat_value10`, `dmg_min1`, `dmg_max1`, `dmg_type1`, `dmg_min2`, `dmg_max2`, `dmg_type2`, `dmg_min3`, `dmg_max3`, `dmg_type3`, `dmg_min4`, `dmg_max4`, `dmg_type4`, `dmg_min5`, `dmg_max5`, `dmg_type5`, `armor`, `holy_res`, `fire_res`, `nature_res`, `frost_res`, `shadow_res`, `arcane_res`, `delay`, `ammo_type`, `RangedModRange`, `spellid_1`, `spelltrigger_1`, `spellcharges_1`, `spellppmRate_1`, `spellcooldown_1`, `spellcategory_1`, `spellcategorycooldown_1`, `spellid_2`, `spelltrigger_2`, `spellcharges_2`, `spellppmRate_2`, `spellcooldown_2`, `spellcategory_2`, `spellcategorycooldown_2`, `spellid_3`, `spelltrigger_3`, `spellcharges_3`, `spellppmRate_3`, `spellcooldown_3`, `spellcategory_3`, `spellcategorycooldown_3`, `spellid_4`, `spelltrigger_4`, `spellcharges_4`, `spellppmRate_4`, `spellcooldown_4`, `spellcategory_4`, `spellcategorycooldown_4`, `spellid_5`, `spelltrigger_5`, `spellcharges_5`, `spellppmRate_5`, `spellcooldown_5`, `spellcategory_5`, `spellcategorycooldown_5`, `bonding`, `description`, `PageText`, `LanguageID`, `PageMaterial`, `startquest`, `lockid`, `Material`, `sheath`, `RandomProperty`, `RandomSuffix`, `block`, `itemset`, `MaxDurability`, `area`, `Map`, `BagFamily`, `TotemCategory`, `socketColor_1`, `socketContent_1`, `socketColor_2`, `socketContent_2`, `socketColor_3`, `socketContent_3`, `socketBonus`, `GemProperties`, `RequiredDisenchantSkill`, `ArmorDamageModifier`, `ScriptName`, `DisenchantID`, `FoodType`, `minMoneyLoot`, `maxMoneyLoot`, `Duration`) VALUES
  63. +(100010, 15, 4, -1, 'Portal to GM Island', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to the legendary home of the GameMasters.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  64. +(100011, 15, 4, -1, 'Portal to Hyjal', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to Hyjal.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  65. +(100012, 15, 4, -1, 'Portal to Karazhan Crypt', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to Karazhan Crypt.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  66. +(100013, 15, 4, -1, 'Portal to the Tanaris Islands', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to the Tanaris Islands.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  67. +(100014, 15, 4, -1, 'Portal to Old Ironforge', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to Old Ironforge.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  68. +(100015, 15, 4, -1, 'Portal to Stormwind Prison', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to Stormwind Prison.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  69. +(100016, 15, 4, -1, 'Portal to Wetlands Farm', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to the Wetlands Farm.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  70. +(100018, 15, 4, -1, 'Portal to Shattrath City', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to Shattrath City.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  71. +(100020, 15, 4, -1, 'Portal to Undercity', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to Undercity.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  72. +(100021, 15, 4, -1, 'Portal to Thunder Bluff', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to Thunder Bluff.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  73. +(100022, 15, 4, -1, 'Portal to Darnassus', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to Darnassus.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  74. +(100023, 15, 4, -1, 'Portal to The Exodar', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to The Exodar.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  75. +(100024, 15, 4, -1, 'Portal to Ironforge', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to Ironforge.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  76. +(100025, 15, 4, -1, 'Portal to Orgrimmar', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to Orgrimmar.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  77. +(100026, 15, 4, -1, 'Portal to Silvermoon City', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to Silvermoon City.', 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, 'item_teleport', 0, 0, 0, 0, 0),
  78. +(100027, 15, 4, -1, 'Portal to Stormwind City', 14993, 4, 524353, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 36967, 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, 0, 0, 0, 0, -1, 0, -1, 3, 'This magic tome will transport you to Stormwind City.', 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, 'item_teleport', 0, 0, 0, 0, 0);
  79. +
  80. +
  81. diff -Nuar oregoncore-current/src/game/ScriptLoader.cpp oregoncore-pq/src/game/ScriptLoader.cpp
  82. --- oregoncore-current/src/game/ScriptLoader.cpp        2011-01-01 10:03:08.000000000 -0500
  83. +++ oregoncore-pq/src/game/ScriptLoader.cpp        2011-01-01 10:16:13.000000000 -0500
  84. @@ -11,6 +11,9 @@

  85. #ifdef SCRIPTS

  86. +//custom
  87. +void AddSC_item_teleport();
  88. +
  89. //examples
  90. //void AddSC_custom_example();
  91. //void AddSC_custom_gossip_codebox();
  92. @@ -379,6 +382,10 @@
  93. void AddScripts()
  94. {
  95. #ifdef SCRIPTS
  96. +
  97. +    //Custom
  98. +    AddSC_item_teleport();
  99. +
  100. //    AddSC_custom_example();
  101. //    AddSC_custom_gossip_codebox();
  102. //    AddSC_test();
  103. diff -Nuar oregoncore-current/src/scripts/Custom/item_teleport.cpp oregoncore-pq/src/scripts/Custom/item_teleport.cpp
  104. --- oregoncore-current/src/scripts/Custom/item_teleport.cpp        1969-12-31 19:00:00.000000000 -0500
  105. +++ oregoncore-pq/src/scripts/Custom/item_teleport.cpp        2011-01-01 10:16:13.000000000 -0500
  106. @@ -0,0 +1,48 @@
  107. +/* ScriptData
  108. +SDName: Item_Teleport
  109. +SD%Complete: 100
  110. +SDComment: Used for Teleport Item Scripts
  111. +SDCategory: Items
  112. +EndScriptData */
  113. +
  114. +#include "ScriptPCH.h"
  115. +#include <cstring>
  116. +
  117. +bool ItemUse_item_teleport(Player *player, Item* _Item, SpellCastTargets const& targets)
  118. +{
  119. +    // Declare variables
  120. +    float x_pos, y_pos, z_pos, o_pos;
  121. +    uint32 mapid;
  122. +    uint32 itemId = _Item->GetEntry();
  123. +    extern DatabaseType WorldDatabase;
  124. +
  125. +    // Fetch the coordinates
  126. +    QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT `mapid`, `X_pos`, `Y_pos`, `Z_pos`, `orientation`  FROM `item_teleports` WHERE `entry` = '%i' LIMIT 1",itemId);
  127. +    if(result)
  128. +    {
  129. +        Field *fields = result->Fetch();
  130. +        // Read coords from the query result
  131. +        mapid = fields[0].GetInt32();
  132. +        x_pos = fields[1].GetFloat();
  133. +        y_pos = fields[2].GetFloat();
  134. +        z_pos = fields[3].GetFloat();
  135. +        o_pos = fields[4].GetFloat();
  136. +        // Teleport the player and show info in log
  137. +        player->TeleportTo(mapid, x_pos, y_pos, z_pos, o_pos);
  138. +        outstring_log ("Teleport Activated: %i (m:%i x:%f y:%f z:%f o:%f)",itemId,mapid,x_pos,y_pos,z_pos,o_pos);
  139. +        return true;
  140. +    } else {
  141. +        // Teleport failed - show info in log
  142. +        outstring_log ("Teleport Failed: %i (m:%i x:%f y:%f z:%f o:%f)",itemId,mapid,x_pos,y_pos,z_pos,o_pos);
  143. +    }
  144. +}
  145. +
  146. +void AddSC_item_teleport()
  147. +{
  148. +    Script *newscript;
  149. +
  150. +    newscript = new Script;
  151. +    newscript->Name="item_teleport";
  152. +    newscript->pItemUse = &ItemUse_item_teleport;
  153. +    newscript->RegisterSelf();
  154. +}
复制代码
下载完整代码

标签:魔兽私服
 

精彩评论4

倒序浏览
shanda91ty 发表于 2023-4-18 23:31:14 | 显示全部楼层
 
学习研究一下
 
howill 发表于 2022-1-21 11:24:25 | 显示全部楼层
 
这个是最方便的了
 
aokey1984 发表于 2021-12-25 09:29:21 | 显示全部楼层
 
感谢分享,学习学习!
 
仲夏丶绕圈圈 发表于 2020-7-13 17:47:58 | 显示全部楼层
 
好东西 收下了
 
VIP介绍
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 最佳新人

    注册账号后积极发帖的会员
  • 活跃会员

    经常参与各类话题的讨论,发帖内容较有主见
  • 热心会员

    经常帮助其他会员答疑
  • 推广达人

    积极宣传本站,为本站带来更多注册会员
  • 宣传达人

    积极宣传本站,为本站带来更多的用户访问量
  • 灌水之王

    经常在论坛发帖,且发帖量较大
  • 突出贡献

    长期对论坛的繁荣而不断努力,或多次提出建设性意见
  • 优秀版主

    活跃且尽责职守的版主
  • 荣誉管理

    曾经为论坛做出突出贡献目前已离职的版主
  • 论坛元老

    为论坛做出突出贡献的会员

0关注

6粉丝

3567帖子

排行榜
作者专栏

QQ交流群&&微信订阅号

QQ交流群

微信订阅号

吾爱尚玩资源基地永久域名:

Www.523Play.Com

在线管理员QQ:1589479632

邮箱:Email@523play.com

QQ交流群:558936238

Copyright   ©2015-2116  吾爱尚玩资源基地|523play.comPowered by©523Pplay.Com技术支持:吾爱尚玩资源基地