Advertisement
sorvani

Drop/Create merc view

Aug 4th, 2013
472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.39 KB | None | 0 0
  1. DROP VIEW IF EXISTS vwMercNpcTypes;
  2. CREATE VIEW vwMercNpcTypes AS
  3. SELECT
  4.             ms.merc_npc_type_id,
  5.             '' AS name,
  6.             ms.clientlevel,
  7.             ms.level,
  8.             mtyp.race_id,
  9.             mstyp.class_id,
  10.             ms.hp,
  11.             ms.mana,
  12.             0 AS gender,
  13.             mai.texture,
  14.             mai.helmtexture,
  15.             ms.attack_speed,
  16.             ms.STR,
  17.             ms.STA,
  18.             ms.DEX,
  19.             ms.AGI,
  20.             ms._INT,
  21.             ms.WIS,
  22.             ms.CHA,
  23.             ms.MR,
  24.             ms.CR,
  25.             ms.DR,
  26.             ms.FR,
  27.             ms.PR,
  28.             ms.Corrup,
  29.             ms.mindmg,
  30.             ms.maxdmg,
  31.             ms.attack_count,
  32.             ms.special_abilities,
  33.             mwi.d_meele_texture1,
  34.             mwi.d_meele_texture2,
  35.             mwi.prim_melee_type,
  36.             mwi.sec_melee_type,
  37.             ms.runspeed,
  38.             ms.hp_regen_rate,
  39.             ms.mana_regen_rate,
  40.             1 AS bodytype,
  41.             mai.armortint_id,
  42.             mai.armortint_red,
  43.             mai.armortint_green,
  44.             mai.armortint_blue,
  45.             ms.AC,
  46.             ms.ATK,
  47.             ms.Accuracy,
  48.             ms.spellscale,
  49.             ms.healscale
  50.             FROM merc_stats ms
  51.             INNER JOIN merc_armorinfo mai
  52.             ON ms.merc_npc_type_id = mai.merc_npc_type_id
  53.             AND mai.minlevel <= ms.level AND mai.maxlevel >= ms.level
  54.             INNER JOIN merc_weaponinfo mwi
  55.             ON ms.merc_npc_type_id = mwi.merc_npc_type_id
  56.             AND mwi.minlevel <= ms.level AND mwi.maxlevel >= ms.level
  57.             INNER JOIN merc_templates mtem
  58.             ON mtem.merc_npc_type_id = ms.merc_npc_type_id
  59.             INNER JOIN merc_types mtyp
  60.       ON mtem.merc_type_id = mtyp.merc_type_id
  61.       INNER JOIN merc_subtypes mstyp
  62.       ON mtem.merc_subtype_id = mstyp.merc_subtype_id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement