Index: conf/commands.conf =================================================================== --- conf/commands.conf (revision 1672) +++ conf/commands.conf (working copy) @@ -44,3 +44,4 @@ commands_ini[30] = { ["name"] = "pardon", ["path"] = "scripts/commands", ["parameters"] = "s" }; commands_ini[31] = { ["name"] = "timeoffset", ["path"] = "scripts/commands", ["parameters"] = "i" }; commands_ini[32] = { ["name"] = "setweather", ["path"] = "scripts/commands", ["parameters"] = "s" }; +commands_ini[33] = { ["name"] = "changesjob", ["path"] = "scripts/commands", ["parameters"] = "si" }; \ No newline at end of file Index: documentation/Waughroon_Shrine_armory_crates.txt =================================================================== --- documentation/Waughroon_Shrine_armory_crates.txt (revision 0) +++ documentation/Waughroon_Shrine_armory_crates.txt (revision 0) @@ -0,0 +1,41 @@ +Waughroon_Shrine +armory crates +17367089 - operation desert swarm +17367093 - operation desert swarm +17367097 - operation desert swarm +17367101 - hills are alive +17367105 - hills are alive +17367109 - hills are alive +17367113 +17367117 +17367121 +17367138 +17367155 +17367172 +17367182 +17367192 +17367202 +17367204 +17367206 +17367208 +17367215 +17367222 +17367229 +17367231 +17367233 +17367235 +17367237 +17367239 +17367241 +17367243 +17367245 +17367247 +17367249 +17367255 +17367261 +17367272 +17367279 +17367286 +17367291 +17367296 +17367301 Index: scripts/commands/changesjob.lua =================================================================== --- scripts/commands/changesjob.lua (revision 0) +++ scripts/commands/changesjob.lua (revision 0) @@ -0,0 +1,61 @@ +----------------------------------- +-- [Command name]: changesJob +-- [Author ]: +-- [Description ]: Changes sub job to the specified job and level +----------------------------------- + +----------------------------------- +-- Action +----------------------------------- + +function onTrigger(player,jobname,lvl) + --parse the jobname + if(jobname=="WAR" or jobname=="war" or jobname=='1') then + player:changesJob(1); + elseif(jobname=="MNK" or jobname=="mnk" or jobname=='2') then + player:changesJob(2); + elseif(jobname=="WHM" or jobname=="whm" or jobname=='3') then + player:changesJob(3); + elseif(jobname=="BLM" or jobname=="blm" or jobname=='4') then + player:changesJob(4); + elseif(jobname=="RDM" or jobname=="rdm" or jobname=='5') then + player:changesJob(5); + elseif(jobname=="THF" or jobname=="thf" or jobname=='6') then + player:changesJob(6); + elseif(jobname=="PLD" or jobname=="pld" or jobname=='7') then + player:changesJob(7); + elseif(jobname=="DRK" or jobname=="drk" or jobname=='8') then + player:changesJob(8); + elseif(jobname=="BST" or jobname=="bst" or jobname=='9') then + player:changesJob(9); + elseif(jobname=="BRD" or jobname=="brd" or jobname=='10') then + player:changesJob(10); + elseif(jobname=="RNG" or jobname=="rng" or jobname=='11') then + player:changesJob(11); + elseif(jobname=="SAM" or jobname=="sam" or jobname=='12') then + player:changesJob(12); + elseif(jobname=="NIN" or jobname=="nin" or jobname=='13') then + player:changesJob(13); + elseif(jobname=="DRG" or jobname=="drg" or jobname=='14') then + player:changesJob(14); + elseif(jobname=="SMN" or jobname=="smn" or jobname=='15') then + player:changesJob(15); + elseif(jobname=="BLU" or jobname=="blu" or jobname=='16') then + player:changesJob(16); + elseif(jobname=="COR" or jobname=="cor" or jobname=='17') then + player:changesJob(17); + elseif(jobname=="PUP" or jobname=="pup" or jobname=='18') then + player:changesJob(18); + elseif(jobname=="DNC" or jobname=="dnc" or jobname=='19') then + player:changesJob(19); + elseif(jobname=="SCH" or jobname=="sch" or jobname=='20') then + player:changesJob(20); + else + print('Unrecognised job (1st param) entered. Use the ID number or short name e.g. WAR'); + end + if(lvl>0 and lvl<=99) then + player:setsLevel(lvl); + else + print('Level (2nd param) must be between 1~99'); + end +end; \ No newline at end of file Index: scripts/zones/Balgas_Dais/bcnms/early_bird_catches_the_wyrm.lua =================================================================== --- scripts/zones/Balgas_Dais/bcnms/early_bird_catches_the_wyrm.lua (revision 0) +++ scripts/zones/Balgas_Dais/bcnms/early_bird_catches_the_wyrm.lua (revision 0) @@ -0,0 +1,58 @@ +----------------------------------- +-- Area: Balgas_Dais +-- Name: early bird catches the wyrm +----------------------------------- +package.loaded["scripts/zones/Waughroon_Shrine/TextIDs"] = nil; +----------------------------------- + +require("scripts/globals/titles"); +require("scripts/globals/quests"); +require("scripts/zones/Waughroon_Shrine/TextIDs"); + +----------------------------------- +-- EXAMPLE SCRIPT +-- +-- What should go here: +-- giving key items, playing ENDING cutscenes +-- +-- What should NOT go here: +-- Handling of "battlefield" status, spawning of monsters, +-- putting loot into treasure pool, +-- enforcing ANY rules (SJ/number of people/etc), moving +-- chars around, playing entrance CSes (entrance CSes go in bcnm.lua) + +-- After registering the BCNM via bcnmRegister(bcnmid) +function OnBcnmRegister(player,instance) +end; + +-- Physically entering the BCNM via bcnmEnter(bcnmid) +function OnBcnmEnter(player,instance) +end; + +-- Leaving the BCNM by every mean possible, given by the LeaveCode +-- 1=Select Exit on circle +-- 2=Winning the BC +-- 3=Disconnected or warped out +-- 4=Losing the BC +-- via bcnmLeave(1) or bcnmLeave(2). LeaveCodes 3 and 4 are called +-- from the core when a player disconnects or the time limit is up, etc + +function OnBcnmLeave(player,instance,leavecode) +-- print("leave code "..leavecode); + + + if(leavecode == 2) then -- play end CS. Need time and battle id for record keeping + storage + player:startEvent(0x7d01,1,1,1,instance:getTimeInside(),1,1,0); + elseif(leavecode == 4) then + player:startEvent(0x7d02); + end + +end; + +function onEventUpdate(player,csid,option) +-- print("bc update csid "..csid.." and option "..option); +end; + +function onEventFinish(player,csid,option) +-- print("bc finish csid "..csid.." and option "..option); +end; \ No newline at end of file Index: scripts/zones/Balgas_Dais/mobs/Wyrm.lua =================================================================== --- scripts/zones/Balgas_Dais/mobs/Wyrm.lua (revision 0) +++ scripts/zones/Balgas_Dais/mobs/Wyrm.lua (revision 0) @@ -0,0 +1,19 @@ +----------------------------------- +-- Area: Balga's Dais +-- NPC: Wyrm +-- KSNM99 +----------------------------------- + +----------------------------------- +-- onMobSpawn Action +----------------------------------- + +function OnMobSpawn(mob) +end; + +----------------------------------- +-- onMobDeath Action +----------------------------------- + +function onMobDeath(mob,killer) +end; \ No newline at end of file Index: scripts/zones/Horlais_Peak/bcnms/horns_of_war.lua =================================================================== --- scripts/zones/Horlais_Peak/bcnms/horns_of_war.lua (revision 0) +++ scripts/zones/Horlais_Peak/bcnms/horns_of_war.lua (revision 0) @@ -0,0 +1,59 @@ +----------------------------------- +-- Area: Horlias peak +-- Name: horns of war +-- KSNM99 +----------------------------------- +package.loaded["scripts/zones/Waughroon_Shrine/TextIDs"] = nil; +----------------------------------- + +require("scripts/globals/titles"); +require("scripts/globals/quests"); +require("scripts/zones/Waughroon_Shrine/TextIDs"); + +----------------------------------- +-- EXAMPLE SCRIPT +-- +-- What should go here: +-- giving key items, playing ENDING cutscenes +-- +-- What should NOT go here: +-- Handling of "battlefield" status, spawning of monsters, +-- putting loot into treasure pool, +-- enforcing ANY rules (SJ/number of people/etc), moving +-- chars around, playing entrance CSes (entrance CSes go in bcnm.lua) + +-- After registering the BCNM via bcnmRegister(bcnmid) +function OnBcnmRegister(player,instance) +end; + +-- Physically entering the BCNM via bcnmEnter(bcnmid) +function OnBcnmEnter(player,instance) +end; + +-- Leaving the BCNM by every mean possible, given by the LeaveCode +-- 1=Select Exit on circle +-- 2=Winning the BC +-- 3=Disconnected or warped out +-- 4=Losing the BC +-- via bcnmLeave(1) or bcnmLeave(2). LeaveCodes 3 and 4 are called +-- from the core when a player disconnects or the time limit is up, etc + +function OnBcnmLeave(player,instance,leavecode) +-- print("leave code "..leavecode); + + + if(leavecode == 2) then -- play end CS. Need time and battle id for record keeping + storage + player:startEvent(0x7d01,1,1,1,instance:getTimeInside(),1,1,0); + elseif(leavecode == 4) then + player:startEvent(0x7d02); + end + +end; + +function onEventUpdate(player,csid,option) +-- print("bc update csid "..csid.." and option "..option); +end; + +function onEventFinish(player,csid,option) +-- print("bc finish csid "..csid.." and option "..option); +end; \ No newline at end of file Index: scripts/zones/Horlais_Peak/mobs/Chlevnik.lua =================================================================== --- scripts/zones/Horlais_Peak/mobs/Chlevnik.lua (revision 0) +++ scripts/zones/Horlais_Peak/mobs/Chlevnik.lua (revision 0) @@ -0,0 +1,19 @@ +----------------------------------- +-- Area: Horlais Peak +-- NPC: Chlevnik +-- KSNM99 +----------------------------------- + +----------------------------------- +-- onMobSpawn Action +----------------------------------- + +function OnMobSpawn(mob) +end; + +----------------------------------- +-- onMobDeath Action +----------------------------------- + +function onMobDeath(mob,killer) +end; \ No newline at end of file Index: scripts/zones/Waughroon_Shrine/bcnms/hills_are_alive.lua =================================================================== --- scripts/zones/Waughroon_Shrine/bcnms/hills_are_alive.lua (revision 0) +++ scripts/zones/Waughroon_Shrine/bcnms/hills_are_alive.lua (revision 0) @@ -0,0 +1,59 @@ +----------------------------------- +-- Area: Waughroon_Shrine +-- Name: Hills are Alive +-- KSNM99 +----------------------------------- +package.loaded["scripts/zones/Waughroon_Shrine/TextIDs"] = nil; +----------------------------------- + +require("scripts/globals/titles"); +require("scripts/globals/quests"); +require("scripts/zones/Waughroon_Shrine/TextIDs"); + +----------------------------------- +-- EXAMPLE SCRIPT +-- +-- What should go here: +-- giving key items, playing ENDING cutscenes +-- +-- What should NOT go here: +-- Handling of "battlefield" status, spawning of monsters, +-- putting loot into treasure pool, +-- enforcing ANY rules (SJ/number of people/etc), moving +-- chars around, playing entrance CSes (entrance CSes go in bcnm.lua) + +-- After registering the BCNM via bcnmRegister(bcnmid) +function OnBcnmRegister(player,instance) +end; + +-- Physically entering the BCNM via bcnmEnter(bcnmid) +function OnBcnmEnter(player,instance) +end; + +-- Leaving the BCNM by every mean possible, given by the LeaveCode +-- 1=Select Exit on circle +-- 2=Winning the BC +-- 3=Disconnected or warped out +-- 4=Losing the BC +-- via bcnmLeave(1) or bcnmLeave(2). LeaveCodes 3 and 4 are called +-- from the core when a player disconnects or the time limit is up, etc + +function OnBcnmLeave(player,instance,leavecode) +-- print("leave code "..leavecode); + + + if(leavecode == 2) then -- play end CS. Need time and battle id for record keeping + storage + player:startEvent(0x7d01,1,1,1,instance:getTimeInside(),1,1,0); + elseif(leavecode == 4) then + player:startEvent(0x7d02); + end + +end; + +function onEventUpdate(player,csid,option) +-- print("bc update csid "..csid.." and option "..option); +end; + +function onEventFinish(player,csid,option) +-- print("bc finish csid "..csid.." and option "..option); +end; \ No newline at end of file Index: scripts/zones/Waughroon_Shrine/bcnms/operation_desert_swarm.lua =================================================================== --- scripts/zones/Waughroon_Shrine/bcnms/operation_desert_swarm.lua (revision 0) +++ scripts/zones/Waughroon_Shrine/bcnms/operation_desert_swarm.lua (revision 0) @@ -0,0 +1,58 @@ +----------------------------------- +-- Area: Waughroon_Shrine +-- Name: Operation desert swarm +----------------------------------- +package.loaded["scripts/zones/Waughroon_Shrine/TextIDs"] = nil; +----------------------------------- + +require("scripts/globals/titles"); +require("scripts/globals/quests"); +require("scripts/zones/Waughroon_Shrine/TextIDs"); + +----------------------------------- +-- EXAMPLE SCRIPT +-- +-- What should go here: +-- giving key items, playing ENDING cutscenes +-- +-- What should NOT go here: +-- Handling of "battlefield" status, spawning of monsters, +-- putting loot into treasure pool, +-- enforcing ANY rules (SJ/number of people/etc), moving +-- chars around, playing entrance CSes (entrance CSes go in bcnm.lua) + +-- After registering the BCNM via bcnmRegister(bcnmid) +function OnBcnmRegister(player,instance) +end; + +-- Physically entering the BCNM via bcnmEnter(bcnmid) +function OnBcnmEnter(player,instance) +end; + +-- Leaving the BCNM by every mean possible, given by the LeaveCode +-- 1=Select Exit on circle +-- 2=Winning the BC +-- 3=Disconnected or warped out +-- 4=Losing the BC +-- via bcnmLeave(1) or bcnmLeave(2). LeaveCodes 3 and 4 are called +-- from the core when a player disconnects or the time limit is up, etc + +function OnBcnmLeave(player,instance,leavecode) +-- print("leave code "..leavecode); + + + if(leavecode == 2) then -- play end CS. Need time and battle id for record keeping + storage + player:startEvent(0x7d01,1,1,1,instance:getTimeInside(),1,1,0); + elseif(leavecode == 4) then + player:startEvent(0x7d02); + end + +end; + +function onEventUpdate(player,csid,option) +-- print("bc update csid "..csid.." and option "..option); +end; + +function onEventFinish(player,csid,option) +-- print("bc finish csid "..csid.." and option "..option); +end; \ No newline at end of file Index: scripts/zones/Waughroon_Shrine/mobs/Platoon_Scorpion.lua =================================================================== --- scripts/zones/Waughroon_Shrine/mobs/Platoon_Scorpion.lua (revision 0) +++ scripts/zones/Waughroon_Shrine/mobs/Platoon_Scorpion.lua (revision 0) @@ -0,0 +1,19 @@ +----------------------------------- +-- Area: Waughroon Shrine +-- NPC: Platoon Scorpion +----------------------------------- + + +----------------------------------- +-- onMobSpawn Action +----------------------------------- + +function OnMobSpawn(mob) +end; + +----------------------------------- +-- onMobDeath Action +----------------------------------- + +function onMobDeath(mob,killer) +end; \ No newline at end of file Index: scripts/zones/Waughroon_Shrine/mobs/Tartaruga_Gigante.lua =================================================================== --- scripts/zones/Waughroon_Shrine/mobs/Tartaruga_Gigante.lua (revision 0) +++ scripts/zones/Waughroon_Shrine/mobs/Tartaruga_Gigante.lua (revision 0) @@ -0,0 +1,19 @@ +----------------------------------- +-- Area: Waughroon Shrine +-- NPC: Tartaruga Gigante +----------------------------------- + + +----------------------------------- +-- onMobSpawn Action +----------------------------------- + +function OnMobSpawn(mob) +end; + +----------------------------------- +-- onMobDeath Action +----------------------------------- + +function onMobDeath(mob,killer) +end; \ No newline at end of file Index: scripts/zones/Waughroon_Shrine/npcs/Armoury_Crate.lua =================================================================== --- scripts/zones/Waughroon_Shrine/npcs/Armoury_Crate.lua (revision 0) +++ scripts/zones/Waughroon_Shrine/npcs/Armoury_Crate.lua (revision 0) @@ -0,0 +1,41 @@ +----------------------------------- +-- Area: Waughroon Shrine +-- NPC: Armoury Crate +-- Waughroon Shrine Burning Armoury_Crate +------------------------------------- +package.loaded["scripts/zones/Waughroon_Shrine/TextIDs"] = nil; +package.loaded["scripts/globals/bcnm"] = nil; +------------------------------------- + +require("scripts/globals/bcnm"); +require("scripts/zones/Waughroon_Shrine/TextIDs"); + + +----------------------------------- +-- onTrade Action +----------------------------------- + +function onTrade(player,npc,trade) +end; + +----------------------------------- +-- onTrigger Action +----------------------------------- + +function onTrigger(player,npc) + player:getBCNMloot(); +end; + +----------------------------------- +-- onEventUpdate +----------------------------------- + +function onEventUpdate(player,csid,option) +end; + +----------------------------------- +-- onEventFinish Action +----------------------------------- + +function onEventFinish(player,csid,option) +end; \ No newline at end of file Index: scripts/zones/Waughroon_Shrine/npcs/Burning_Circle.lua =================================================================== --- scripts/zones/Waughroon_Shrine/npcs/Burning_Circle.lua (revision 1672) +++ scripts/zones/Waughroon_Shrine/npcs/Burning_Circle.lua (working copy) @@ -24,16 +24,21 @@ ---- 6: Shattering Stars (RDM) ---- 7: Shattering Stars (THF) ---- 8: Shattering Stars (BST) - ---- 9: - ---- 10: - ---- 11: - ---- 12: - ---- 13: - ---- 14: - ---- 15: - ---- 16: - ---- 17: + ---- 9: Birds of the feather + ---- 10: Crustacean Conundrum + ---- 11: Grove Gardians + ---- 12: The Hills are alive + ---- 13: Royal Jelly + ---- 14: The Final Bout + ---- 15: Up in arms + ---- 16: Copy Cat + ---- 17: Operation Desert Swarm + ---- 18: Prehistoric Pigeons + ---- 19: The Palborough Project + ---- 20: Shell Shocked + ---- 21: Beyond infinity + ----------------------------------- -- onTrade Action ----------------------------------- Index: sql/bcnm_instance.sql =================================================================== --- sql/bcnm_instance.sql (revision 1672) +++ sql/bcnm_instance.sql (working copy) @@ -44,6 +44,9 @@ INSERT INTO `bcnm_instance` VALUES ('7', '1', '17346591'); INSERT INTO `bcnm_instance` VALUES ('7', '2', '17346592'); INSERT INTO `bcnm_instance` VALUES ('7', '3', '17346593'); +INSERT INTO `bcnm_instance` VALUES ('11', '1', '17346717'); +INSERT INTO `bcnm_instance` VALUES ('11', '2', '17346719'); +INSERT INTO `bcnm_instance` VALUES ('11', '3', '17346721'); -- Ghelsba Outpost INSERT INTO `bcnm_instance` VALUES ('32', '1', '17350662'); @@ -82,6 +85,27 @@ INSERT INTO `bcnm_instance` VALUES ('72', '2', '17367083'); INSERT INTO `bcnm_instance` VALUES ('72', '3', '17367084'); INSERT INTO `bcnm_instance` VALUES ('72', '3', '17367085'); +INSERT INTO `bcnm_instance` VALUES ('81', '1', '17367266'); +INSERT INTO `bcnm_instance` VALUES ('81', '1', '17367267'); +INSERT INTO `bcnm_instance` VALUES ('81', '1', '17367268'); +INSERT INTO `bcnm_instance` VALUES ('81', '1', '17367269'); +INSERT INTO `bcnm_instance` VALUES ('81', '1', '17367270'); +INSERT INTO `bcnm_instance` VALUES ('81', '1', '17367271'); +INSERT INTO `bcnm_instance` VALUES ('81', '2', '17367272'); +INSERT INTO `bcnm_instance` VALUES ('81', '2', '17367273'); +INSERT INTO `bcnm_instance` VALUES ('81', '2', '17367274'); +INSERT INTO `bcnm_instance` VALUES ('81', '2', '17367275'); +INSERT INTO `bcnm_instance` VALUES ('81', '2', '17367276'); +INSERT INTO `bcnm_instance` VALUES ('81', '2', '17367277'); +INSERT INTO `bcnm_instance` VALUES ('81', '3', '17367278'); +INSERT INTO `bcnm_instance` VALUES ('81', '3', '17367279'); +INSERT INTO `bcnm_instance` VALUES ('81', '3', '17367280'); +INSERT INTO `bcnm_instance` VALUES ('81', '3', '17367281'); +INSERT INTO `bcnm_instance` VALUES ('81', '3', '17367282'); +INSERT INTO `bcnm_instance` VALUES ('81', '3', '17367283'); +INSERT INTO `bcnm_instance` VALUES ('76', '1', '17367230'); +INSERT INTO `bcnm_instance` VALUES ('76', '2', '17367232'); +INSERT INTO `bcnm_instance` VALUES ('76', '3', '17367234'); -- Balga's Dais INSERT INTO `bcnm_instance` VALUES ('96', '1', '17375233'); @@ -102,6 +126,9 @@ INSERT INTO `bcnm_instance` VALUES ('103', '2', '17375266'); INSERT INTO `bcnm_instance` VALUES ('103', '3', '17375267'); INSERT INTO `bcnm_instance` VALUES ('103', '3', '17375268'); +INSERT INTO `bcnm_instance` VALUES ('107', '1', '17375386'); +INSERT INTO `bcnm_instance` VALUES ('107', '2', '17375388'); +INSERT INTO `bcnm_instance` VALUES ('107', '3', '17375390'); -- Sacrificial Chamber INSERT INTO `bcnm_instance` VALUES ('128', '1', '17444865'); Index: sql/bcnm_treasure_chests.sql =================================================================== --- sql/bcnm_treasure_chests.sql (revision 0) +++ sql/bcnm_treasure_chests.sql (revision 0) @@ -0,0 +1,75 @@ +/* +Navicat MySQL Data Transfer + +Source Server : DarkStar +Source Server Version : 50515 +Source Host : localhost:3306 +Source Database : dspdb + +Target Server Type : MYSQL +Target Server Version : 50515 +File Encoding : 65001 + +Date: 2011-10-28 20:17:52 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for `bcnm_treasure_chests` +-- ---------------------------- +DROP TABLE IF EXISTS `bcnm_treasure_chests`; +CREATE TABLE `bcnm_treasure_chests` ( + `bcnmId` smallint(5) unsigned NOT NULL, + `instanceNumber` tinyint(3), + `npcId` int(10) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AVG_ROW_LENGTH=56; + +-- ---------------------------- +-- Records of instance +-- ---------------------------- +-- Horlais Peak + +--INSERT INTO `bcnm_treasure_chests` VALUES ('11', '1', '17346717'); +--INSERT INTO `bcnm_treasure_chests` VALUES ('11', '2', '17346719'); +--INSERT INTO `bcnm_treasure_chests` VALUES ('11', '3', '17346721'); + +-- Ghelsba Outpost + +-- Waughroon Shrine +INSERT INTO `bcnm_treasure_chests` VALUES ('81', '1', '17367089'); +INSERT INTO `bcnm_treasure_chests` VALUES ('81', '2', '17367093'); +INSERT INTO `bcnm_treasure_chests` VALUES ('81', '3', '17367097'); +INSERT INTO `bcnm_treasure_chests` VALUES ('76', '1', '17367101'); +INSERT INTO `bcnm_treasure_chests` VALUES ('76', '2', '17367105'); +INSERT INTO `bcnm_treasure_chests` VALUES ('76', '3', '17367109'); + +-- Balga's Dais + +--INSERT INTO `bcnm_treasure_chests` VALUES ('107', '1', '17375386'); +--INSERT INTO `bcnm_treasure_chests` VALUES ('107', '2', '17375388'); +--INSERT INTO `bcnm_treasure_chests` VALUES ('107', '3', '17375390'); + +-- Sacrificial Chamber + +-- Throne Room + +-- Chamber of Oracles + +-- Full Moon Fountain + +-- Stellar Fulcrum + +-- Cloister of Gales + +-- Cloister of Storms + +-- Cloister of Frost + +-- Qu'Bia Arena + +-- Cloister of Flames + +-- Cloister of Tremors + +-- Cloister of Tides \ No newline at end of file Index: sql/npc_list.sql =================================================================== --- sql/npc_list.sql (revision 1672) +++ sql/npc_list.sql (working copy) @@ -8504,45 +8504,45 @@ INSERT INTO `npc_list` VALUES ('17367059', 'Gaki', '0', '0.000', '0.000', '0.000', '0', '70', '70', '0', '0', '0', '6', '155', 0x0000E70200000000000000000000000000000000, '0', '144'); INSERT INTO `npc_list` VALUES ('17367060', 'Rasetsu', '0', '0.000', '0.000', '0.000', '0', '70', '70', '0', '0', '0', '6', '155', 0x0000E50200000000000000000000000000000000, '0', '144'); INSERT INTO `npc_list` VALUES ('17367061', 'Onki', '0', '0.000', '0.000', '0.000', '0', '70', '70', '0', '0', '0', '6', '1179', 0x0000E80200000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367089', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367093', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367097', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367101', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367105', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367109', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367113', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367117', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367121', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367138', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367155', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367172', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367182', 'Armoury_Crate', '128', '-177.315', '59.695', '-141.972', '6', '40', '40', '0', '8', '0', '6', '1155', 0x0000C00300000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367192', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367202', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367204', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367206', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367208', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367215', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367222', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367229', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367231', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367233', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367235', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367237', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367239', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367241', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367243', 'Armoury_Crate', '128', '-177.315', '59.695', '-141.972', '7', '40', '40', '0', '8', '0', '6', '1155', 0x0000C10300000000000000000000000000000000, '32', '144'); -INSERT INTO `npc_list` VALUES ('17367245', 'Armoury_Crate', '128', '22.665', '-0.302', '18.048', '7', '40', '40', '0', '8', '0', '6', '1155', 0x0000C10300000000000000000000000000000000, '32', '144'); -INSERT INTO `npc_list` VALUES ('17367247', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367249', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367255', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367261', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367272', 'Armoury_Crate', '128', '-177.315', '59.695', '-141.972', '6', '40', '40', '0', '8', '0', '6', '1155', 0x0000C10300000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367279', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367286', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367291', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367296', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); -INSERT INTO `npc_list` VALUES ('17367301', 'Armoury_Crate', '0', '0.000', '0.000', '0.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000320000000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367089', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367093', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367097', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367101', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '7', '40', '40', '0', '8', '0', '6', '1155', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367105', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367109', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367113', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367117', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367121', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367138', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367155', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367172', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367182', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367192', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367202', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367204', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367206', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367208', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367215', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367222', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367229', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367231', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367233', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367235', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367237', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367239', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367241', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367243', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367245', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367247', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367249', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367255', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367261', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367272', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367279', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367286', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367291', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367296', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); +INSERT INTO `npc_list` VALUES ('17367301', 'Armoury_Crate', '126', '-177.000', '60.000', '-142.000', '0', '40', '40', '0', '0', '0', '6', '3', 0x0000C10300000000000000000000000000000000, '0', '144'); INSERT INTO `npc_list` VALUES ('17367339', 'Burning_Circle', '0', '-339.601', '104.304', '-260.341', '1', '40', '40', '0', '0', '0', '0', '3', 0x0000340000000000000000000000000000000000, '0', '144'); INSERT INTO `npc_list` VALUES ('17367340', 'Burning_Circle', '0', '-260.800', '60.304', '-139.564', '1', '40', '40', '0', '0', '0', '0', '3', 0x0000340000000000000000000000000000000000, '0', '144'); INSERT INTO `npc_list` VALUES ('17367341', 'Burning_Circle', '0', '-60.971', '0.304', '20.262', '1', '40', '40', '0', '0', '0', '0', '3', 0x0000340000000000000000000000000000000000, '0', '144'); @@ -15824,3 +15824,4 @@ INSERT INTO `npc_list` VALUES ('17818269', 'Dominion_Sergeant', '229', '-217.521', '-47.329', '-161.383', '15', '40', '40', '0', '0', '0', '0', '27', 0x010000050E10A220A230A240A250006000700000, '32', '254'); INSERT INTO `npc_list` VALUES ('17818270', 'Machine_Outfitter', '64', '-499.662', '24.368', '-756.559', '8', '40', '40', '0', '0', '0', '0', '3', 0x0100060100101720173017401750006000700000, '0', '254'); INSERT INTO `npc_list` VALUES ('17818271', 'Event_Master', '69', '-549.105', '29.944', '-753.316', '1', '40', '40', '0', '0', '0', '2', '27', 0x0000520000000000000000000000000000000000, '32', '254'); +INSERT INTO `npc_list` VALUES ('17818272', 'qm4', '0', '-40.000', '-1.000', '-148.000', '1', '40', '40', '0', '0', '0', '0', '3', 0x0000340000000000000000000000000000000000, '0', '178'); \ No newline at end of file Index: src/map/ai/ai_char_normal.cpp =================================================================== --- src/map/ai/ai_char_normal.cpp (revision 1672) +++ src/map/ai/ai_char_normal.cpp (working copy) @@ -206,7 +206,7 @@ { if (m_PChar->PParty->m_PAlliance != NULL) { - for (int32 a = 0; a < m_PChar->PParty->m_PAlliance->partyList.size(); ++a) + for (uint8 a = 0; a < m_PChar->PParty->m_PAlliance->partyList.size(); ++a) { for (uint8 i = 0; i < m_PChar->PParty->m_PAlliance->partyList.at(a)->members.size(); ++i) { @@ -216,20 +216,17 @@ } } } + }else{//no alliance + for (uint8 i = 0; i < m_PChar->PParty->members.size(); ++i) + { + if (m_PChar->PParty->members[i]->id == PBattleTarget->m_OwnerID.id) + { + return true; + } + } } } - - if (m_PChar->PParty != NULL) - { - for (uint8 i = 0; i < m_PChar->PParty->members.size(); ++i) - { - if (m_PChar->PParty->members[i]->id == PBattleTarget->m_OwnerID.id) - { - return true; - } - } - } return false; } @@ -1975,7 +1972,7 @@ { if ( m_PChar->PParty->m_PAlliance != NULL) { - for (int32 a = 0; a < m_PChar->PParty->m_PAlliance->partyList.size(); ++a) + for (uint8 a = 0; a < m_PChar->PParty->m_PAlliance->partyList.size(); ++a) { for (uint8 i = 0; i < m_PChar->PParty->m_PAlliance->partyList.at(a)->members.size(); ++i) { Index: src/map/ai/ai_mob_dummy.cpp =================================================================== --- src/map/ai/ai_mob_dummy.cpp (revision 1672) +++ src/map/ai/ai_mob_dummy.cpp (working copy) @@ -230,7 +230,7 @@ { if(PChar->PParty != NULL) - { + { //no alliance if(PChar->PParty->m_PAlliance == NULL) { thf_in_party = false; @@ -240,24 +240,24 @@ if (distance(thPChar->loc.p, m_PMob->loc.p) < 100 && (charutils::hasTrait(thPChar, TRAIT_TREASURE_HUNTER))) thf_in_party = true; } - } - } - if(PChar->PParty != NULL) - { - if(PChar->PParty->m_PAlliance != NULL) - { - thf_in_party = false; - for(int32 a = 0; a < PChar->PParty->m_PAlliance->partyList.size(); ++a) - { - for(uint8 i = 0; i < PChar->PParty->m_PAlliance->partyList[a]->members.size(); i++) + }else{//alliance + thf_in_party = false; + for(uint8 a = 0; a < PChar->PParty->m_PAlliance->partyList.size(); ++a) { - CCharEntity* thPChar = (CCharEntity*)PChar->PParty->m_PAlliance->partyList[a]->members[i]; - if (distance(thPChar->loc.p, m_PMob->loc.p) < 100 && (charutils::hasTrait(thPChar, TRAIT_TREASURE_HUNTER))) + for(uint8 i = 0; i < PChar->PParty->m_PAlliance->partyList[a]->members.size(); i++) + { + CCharEntity* thPChar = (CCharEntity*)PChar->PParty->m_PAlliance->partyList[a]->members[i]; + if (distance(thPChar->loc.p, m_PMob->loc.p) < 100 && (charutils::hasTrait(thPChar, TRAIT_TREASURE_HUNTER))) thf_in_party = true; + } } - } + + } } - } + + + + } if (!thf_in_party) highestTH = 0; for(uint8 i = 0; i < DropList->size(); ++i) @@ -624,9 +624,9 @@ radiusAround = m_PBattleTarget->loc.p; } - for (int32 a = 0; a < m_PChar->PParty->m_PAlliance->partyList.size(); ++a) + for (uint8 a = 0; a < m_PChar->PParty->m_PAlliance->partyList.size(); ++a) { - for (uint32 i = 0; i < m_PChar->PParty->m_PAlliance->partyList.at(a)->members.size(); i++) + for (uint8 i = 0; i < m_PChar->PParty->m_PAlliance->partyList.at(a)->members.size(); i++) { CCharEntity* PTarget = (CCharEntity*)m_PChar->PParty->m_PAlliance->partyList.at(a)->members[i]; Index: src/map/alliance.cpp =================================================================== --- src/map/alliance.cpp (revision 1672) +++ src/map/alliance.cpp (working copy) @@ -93,7 +93,7 @@ CAlliance* alliance = party->m_PAlliance; //delete the party from the alliance list - for (uint32 i = 0; i < party->m_PAlliance->partyList.size(); ++i) + for (uint8 i = 0; i < party->m_PAlliance->partyList.size(); ++i) { if (party == party->m_PAlliance->partyList.at(i)) party->m_PAlliance->partyList.erase(partyList.begin()+i); @@ -104,14 +104,14 @@ //update the remaining members of the alliance to show the party left if (alliance != NULL) { - for (uint32 i = 0; i < alliance->partyList.size(); ++i) + for (uint8 i = 0; i < alliance->partyList.size(); ++i) { alliance->partyList.at(i)->ReloadParty(); } } //remove party members from the alliance treasure pool - for (uint32 i = 0; i < party->members.size(); ++i) + for (uint8 i = 0; i < party->members.size(); ++i) { CCharEntity* PChar = (CCharEntity*)party->members.at(i); PChar->PTreasurePool->DelMember(PChar); @@ -123,18 +123,16 @@ PChar->PTreasurePool->AddMember(PChar); PChar->PTreasurePool->UpdatePool(PChar); - for (uint32 i = 0; i < party->members.size(); ++i) + for (uint8 i = 0; i < party->members.size(); ++i) { CCharEntity* PChar = (CCharEntity*)party->members.at(i); party->ReloadPartyMembers((CCharEntity*)party->members.at(i)); if (PChar->PParty->GetLeader() != PChar) { - //crash is here on disband PChar->PTreasurePool = ((CCharEntity*)PChar->PParty->GetLeader())->PTreasurePool; ((CCharEntity*)PChar->PParty->GetLeader())->PTreasurePool->AddMember(PChar); ((CCharEntity*)PChar->PParty->GetLeader())->PTreasurePool->UpdatePool(PChar); - //PChar->PParty->ReloadTreasurePool(PChar); } } @@ -147,30 +145,12 @@ { party->m_PAlliance = this; partyList.push_back(party); - - /* - if (this->partyCount() > 1) - { - //add the new party to the leading party's treasure pool - for (int32 i = 0; i < party->members.size(); ++i) - { - CCharEntity* PChar = (CCharEntity*)party->members.at(i); - PChar->PTreasurePool->DelMember(PChar); - PChar->PTreasurePool = NULL; - PChar->PTreasurePool = ((CCharEntity*)PChar->PParty->m_PAlliance->getMainParty()->GetLeader())->PTreasurePool; - ((CCharEntity*)PChar->PParty->m_PAlliance->getMainParty()->GetLeader())->PTreasurePool->AddMember(PChar); - ((CCharEntity*)PChar->PParty->m_PAlliance->getMainParty()->GetLeader())->PTreasurePool->UpdatePool(PChar); - PChar->PParty->ReloadTreasurePool(PChar); - } - } - */ - - for (int32 a = 0; a < this->partyList.size(); ++a) + for (uint8 a = 0; a < this->partyList.size(); ++a) { this->partyList.at(a)->ReloadParty(); - for (int32 i = 0; i < this->partyList.at(a)->members.size(); ++i) + for (uint8 i = 0; i < this->partyList.at(a)->members.size(); ++i) { CCharEntity* PChar = (CCharEntity*)this->partyList.at(a)->members.at(i); this->partyList.at(a)->ReloadTreasurePool(PChar); Index: src/map/charutils.cpp =================================================================== --- src/map/charutils.cpp (revision 1672) +++ src/map/charutils.cpp (working copy) @@ -1982,7 +1982,7 @@ }else if (PChar->PParty->m_PAlliance != NULL) { - for (int32 i = 0; i < PChar->PParty->m_PAlliance->partyList.size(); ++i) + for (uint8 i = 0; i < PChar->PParty->m_PAlliance->partyList.size(); ++i) { ((CParty*)PChar->PParty->m_PAlliance->partyList.at(i))->PushPacket(PChar, PChar->getZone(), new CCharHealthPacket(PChar)); } Index: src/map/enmity_container.cpp =================================================================== --- src/map/enmity_container.cpp (revision 1672) +++ src/map/enmity_container.cpp (working copy) @@ -153,7 +153,7 @@ } }else if (PChar->PParty->m_PAlliance != NULL) { - for (int32 a = 0; a < PChar->PParty->m_PAlliance->partyList.size(); ++a) + for (uint8 a = 0; a < PChar->PParty->m_PAlliance->partyList.size(); ++a) { for (uint8 i = 0; i < PChar->PParty->m_PAlliance->partyList.at(a)->members.size(); ++i) { Index: src/map/instance.cpp =================================================================== --- src/map/instance.cpp (revision 1672) +++ src/map/instance.cpp (working copy) @@ -26,6 +26,7 @@ #include "../common/timer.h" #include "charentity.h" #include "mobentity.h" +#include "baseentity.h" #include "packets/position.h" #include "packets/message_basic.h" #include "lua/luautils.h" @@ -36,6 +37,7 @@ m_Handler = hand; locked = false; m_FastestTime = 3600; + treasureChestSpawned = false; } uint16 CInstance::getID(){ @@ -226,6 +228,10 @@ m_EnemyList.push_back(PMob); } +void CInstance::addNpc(CBaseEntity* PNpc){ + m_NpcList.push_back(PNpc); +} + bool CInstance::allEnemiesDefeated(){ for(int i=0; iisDead()){ @@ -258,6 +264,14 @@ } //wipe mob list m_EnemyList.clear(); + + //make chest vanish (if any) + for(int i=0; istatus = STATUS_DISAPPEAR; + } + //wipe npc list + m_NpcList.clear(); + locked = false; //delete instance if(m_Handler==NULL){ @@ -276,6 +290,20 @@ return true; } +bool CInstance::spawnTreasureChest(){ + instanceutils::spawnTreasureForBcnm(this); + return true; +} + +void CInstance::OpenChestinBcnm(){ + instanceutils::getChestItems(this); +} + +/* apparently not used in bcnm +void CInstance::getHighestTHforBcnm(){ + instanceutils::getHighestTHforBcnm(this); +}*/ + bool CInstance::loseBcnm(){ for(int i=0; i m_PlayerList; + std::vector m_NpcList; + private: CInstanceHandler* m_Handler; uint16 m_BcnmID; @@ -120,8 +133,9 @@ uint8 m_MaxParticipants; //1,3,6,12,18,zone CCharEntity* m_CurrentInstanceLeader; std::vector m_EnemyList; - std::vector m_PlayerList; + + }; #endif; \ No newline at end of file Index: src/map/instance_handler.cpp =================================================================== --- src/map/instance_handler.cpp (revision 1672) +++ src/map/instance_handler.cpp (working copy) @@ -41,6 +41,7 @@ for(int i=0; ilocked && PInstance->isPlayersFighting()){ PInstance->lockBcnm(); @@ -69,9 +70,14 @@ if(instanceutils::meetsWinningConditions(PInstance,tick)){ //check rule mask to see if warp immediately or pop a chest if(PInstance->m_RuleMask & RULES_SPAWN_TREASURE_ON_WIN){ - //todo: spawn chest + //spawn chest + if(PInstance->treasureChestSpawned == false) + { ShowDebug("BCNM %i instance %i : Winning conditions met. Spawning chest.\n",PInstance->getID(),PInstance->getInstanceNumber()); - PInstance->winBcnm(); + PInstance->spawnTreasureChest(); + //PInstance->getHighestTHforBcnm(); apparently not used in bcnm + PInstance->treasureChestSpawned = true; + } } else{ ShowDebug("BCNM %i instance %i : Winning conditions met. Exiting battlefield.\n",PInstance->getID(),PInstance->getInstanceNumber()); @@ -224,25 +230,31 @@ case 12: ShowDebug("BCNMs for 12 people are not implemented yet.\n"); break; case 18: - if(PChar->PParty == NULL){//just add the initiator + if(PChar->PParty == NULL){//1 player entering 18 man bcnm if(PInstance->addPlayerToBcnm(PChar)){ ShowDebug("InstanceHandler ::6 Added %s to the valid players list for BCNM %i Instance %i \n", PChar->GetName(),id,PInstance->getInstanceNumber()); } - } - else{ + }else{//alliance entering 18 man bcnm if(PChar->PParty->m_PAlliance != NULL) { - for(int a = 0; a < PChar->PParty->m_PAlliance->partyList.size(); ++a) + for(uint8 a = 0; a < PChar->PParty->m_PAlliance->partyList.size(); ++a) { - for(int j=0;jPParty->m_PAlliance->partyList.at(a)->members.size(); j++){ + for(uint8 j=0;jPParty->m_PAlliance->partyList.at(a)->members.size(); j++){ if(PInstance->addPlayerToBcnm((CCharEntity*)PChar->PParty->m_PAlliance->partyList.at(a)->members.at(j))){ ShowDebug("InstanceHandler ::6 Added %s to the valid players list for BCNM %i Instance %i \n", PChar->PParty->m_PAlliance->partyList.at(a)->members.at(j)->GetName(),id,PInstance->getInstanceNumber()); } } } - } + }else{//single party entering 18 man bcnm + for(uint8 j=0;jPParty->members.size(); j++){ + if(PInstance->addPlayerToBcnm((CCharEntity*)PChar->PParty->members.at(j))){ + ShowDebug("InstanceHandler ::6 Added %s to the valid players list for BCNM %i Instance %i \n", + PChar->PParty->members.at(j)->GetName(),id,PInstance->getInstanceNumber()); + } + } + } } break; @@ -283,4 +295,15 @@ uint32 CInstanceHandler::pollTimeLeft(uint16 id){ return 0; -} \ No newline at end of file +} + +void CInstanceHandler::openTreasureChest(CCharEntity* PChar){ + for(int i=0; iisValidPlayerForBcnm(PChar)){ + CInstance* PInstance = m_Instances[i]; + PInstance->OpenChestinBcnm(); + } + } + } +} Index: src/map/instance_handler.h =================================================================== --- src/map/instance_handler.h (revision 1672) +++ src/map/instance_handler.h (working copy) @@ -50,7 +50,7 @@ uint8 findInstanceIDFor(CCharEntity* PChar); //returns 1 2 3 or 255 if non-existent bool hasFreeInstance(); //returns true if there is a free instance available uint32 pollTimeLeft(uint16 bcnmid); //returns the shortest time left of all 3 instances of the given BCNM ID - + void openTreasureChest(CCharEntity* PChar); void wipeInstance(CInstance* inst); private: uint8 m_ZoneId; Index: src/map/instanceutils.cpp =================================================================== --- src/map/instanceutils.cpp (revision 1672) +++ src/map/instanceutils.cpp (working copy) @@ -24,11 +24,17 @@ #include "charentity.h" #include "mobentity.h" +#include "party.h" +#include "charutils.h" +#include "alliance.h" #include "zoneutils.h" +#include "itemutils.h" #include "instanceutils.h" #include "instance.h" #include "instance_handler.h" +#include "packets/entity_update.h" + namespace instanceutils{ /*************************************************************** Loads the given instance from the database and returns @@ -102,7 +108,6 @@ // PMob-> // ShowDebug("Change maat job to %i \n",instance->getPlayerMainJob()); } - PMob->SetDespawnTimer(0); //never despawn ShowDebug("Spawned %s id %i inst %i \n",PMob->GetName(),instance->getID(),instance->getInstanceNumber()); instance->addEnemy(PMob); @@ -118,6 +123,49 @@ return false; } + + + /*************************************************************** + Spawns treasure chest/armory crate, what ever on winning bcnm + ****************************************************************/ + bool spawnTreasureForBcnm(CInstance* instance){ + DSP_DEBUG_BREAK_IF(instance==NULL); + + //get ids from DB + const int8* fmtQuery = "SELECT npcId \ + FROM bcnm_treasure_chests \ + WHERE bcnmId = %u AND instanceNumber = %u"; + + int32 ret = Sql_Query(SqlHandle, fmtQuery, instance->getID(), instance->getInstanceNumber()); + + if (ret == SQL_ERROR || Sql_NumRows(SqlHandle) == 0) + { + ShowError("spawnTreasureForBcnm : SQL error - Cannot find any npc IDs for BCNMID %i Instance %i \n", + instance->getID(), instance->getInstanceNumber()); + } + else + { + while(Sql_NextRow(SqlHandle) == SQL_SUCCESS) + { + uint32 npcid = Sql_GetUIntData(SqlHandle,0); + CBaseEntity* PNpc = (CBaseEntity*)zoneutils::GetEntity(npcid, TYPE_NPC); + if (PNpc != NULL) + { + PNpc->status = STATUS_NORMAL; + instance->addNpc(PNpc); + ShowDebug(CL_CYAN"Spawned %s id %i inst %i \n",PNpc->status,PNpc->id,instance->getInstanceNumber()); + }else + { + ShowDebug(CL_CYAN"spawnTreasureForBcnm: <%s> is already spawned\n" CL_RESET, PNpc->GetName()); + } + } + return true; + } + return false; + } + + + /************************************************************** Called by ALL BCNMs to check winning conditions every tick. This is usually when all the monsters are defeated but can be other things @@ -228,4 +276,51 @@ } } -}; \ No newline at end of file + + //Just seen on forum that TH does not effect bcnm + /************************************************************* + Get highest TH from the instance + **************************************************************** + void getHighestTHforBcnm(CInstance* instance){ + instance->m_THLvl = 0; + for (uint8 a = 0; a < instance->m_PlayerList.size(); ++a) + { + CCharEntity* PChar = instance->m_PlayerList.at(a); + if (charutils::hasTrait(PChar, TRAIT_TREASURE_HUNTER)) + { + if (instance->m_THLvl == 0) instance->m_THLvl = PChar->getMod(MOD_TREASURE_HUNTER); + else if (instance->m_THLvl < PChar->getMod(MOD_TREASURE_HUNTER)) instance->m_THLvl = PChar->getMod(MOD_TREASURE_HUNTER)+1; + if (instance->m_THLvl > 12) instance->m_THLvl = 12; + } + } + } + */ + + + + /************************************************************* + Get loot from the armoury crate + ****************************************************************/ + + void getChestItems(CInstance* instance){ + DropList_t* DropList = itemutils::GetDropList(instance->getDropId()); + + if (DropList != NULL && DropList->size()) + { + for(uint8 i = 0; i < DropList->size(); ++i) + { + if(rand()%100 < DropList->at(i).DropRate) + { + instance->m_PlayerList.at(0)->PTreasurePool->AddItemFromChest(DropList->at(i).ItemID, instance->m_NpcList.at(0)); + break; + } + } + } + //user opened chest, complete bcnm + instance->winBcnm(); + } + + +}; + + Index: src/map/instanceutils.h =================================================================== --- src/map/instanceutils.h (revision 1672) +++ src/map/instanceutils.h (working copy) @@ -37,6 +37,9 @@ bool meetsWinningConditions(CInstance* instance, uint32 tick); bool meetsLosingConditions(CInstance* instance, uint32 tick); bool spawnMonstersForBcnm(CInstance* instance); + bool spawnTreasureForBcnm(CInstance* instance); + //void getHighestTHforBcnm(CInstance* instance); apparently not used in bcnm + void getChestItems(CInstance* instance); CInstance* loadInstance(CInstanceHandler* hand, uint16 bcnmid); }; Index: src/map/lua/lua_baseentity.cpp =================================================================== --- src/map/lua/lua_baseentity.cpp (revision 1672) +++ src/map/lua/lua_baseentity.cpp (working copy) @@ -3326,6 +3326,8 @@ PChar->jobs.unlocked |= (1 << (uint8)lua_tointeger(L,1)); PChar->SetMJob((uint8)lua_tointeger(L,1)); + + charutils::CalculateStats(PChar); charutils::CheckValidEquipment(PChar); charutils::BuildingCharSkillsTable(PChar); @@ -3353,12 +3355,105 @@ return 0; } + /************************************************************************ * * -* GM command @changeJOB !!! FOR DEBUG ONLY !!! * +<<<<<<< .mine* GM command @setlevel !!! FOR DEBUG ONLY !!! * +=======* GM command @changesJOB !!! FOR DEBUG ONLY !!! * +>>>>>>> .theirs* * +************************************************************************/ + +inline int32 CLuaBaseEntity::changesJob(lua_State *L) +{ + DSP_DEBUG_BREAK_IF(m_PBaseEntity == NULL); + DSP_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC); + + DSP_DEBUG_BREAK_IF(lua_isnil(L,1) || !lua_isnumber(L,1)); + + CCharEntity* PChar = (CCharEntity*)m_PBaseEntity; + + PChar->jobs.unlocked |= (1 << (uint8)lua_tointeger(L,1)); + PChar->SetSJob((uint8)lua_tointeger(L,1)); + + charutils::CalculateStats(PChar); + charutils::CheckValidEquipment(PChar); + charutils::BuildingCharSkillsTable(PChar); + charutils::BuildingCharAbilityTable(PChar); + charutils::BuildingCharTraitsTable(PChar); + charutils::BuildingCharWeaponSkills(PChar); + + PChar->UpdateHealth(); + PChar->health.hp = PChar->GetMaxHP(); + PChar->health.mp = PChar->GetMaxMP(); + + charutils::SaveCharStats(PChar); + charutils::SaveCharJob(PChar, PChar->GetMJob()); + charutils::SaveCharExp(PChar, PChar->GetMJob()); + charutils::UpdateHealth(PChar); + + PChar->pushPacket(new CCharJobsPacket(PChar)); + PChar->pushPacket(new CCharStatsPacket(PChar)); + PChar->pushPacket(new CCharSkillsPacket(PChar)); + PChar->pushPacket(new CCharAbilitiesPacket(PChar)); + PChar->pushPacket(new CCharUpdatePacket(PChar)); + PChar->pushPacket(new CMenuMeritPacket(PChar)); + PChar->pushPacket(new CCharSyncPacket(PChar)); + return 0; +} + + + +/************************************************************************ * * +* GM command @setslevel !!! FOR DEBUG ONLY !!! * +* * ************************************************************************/ +inline int32 CLuaBaseEntity::setsLevel(lua_State *L) +{ + DSP_DEBUG_BREAK_IF(m_PBaseEntity == NULL); + DSP_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC); + + DSP_DEBUG_BREAK_IF(lua_isnil(L,1) || !lua_isnumber(L,1)); + DSP_DEBUG_BREAK_IF(lua_tointeger(L,1) > 99); + + CCharEntity* PChar = (CCharEntity*)m_PBaseEntity; + + //PChar->jobs.exp[PChar->GetSJob()] = 0; + PChar->jobs.job[PChar->GetSJob()] = (uint8)lua_tointeger(L,1); + + charutils::CalculateStats(PChar); + charutils::CheckValidEquipment(PChar); + charutils::BuildingCharSkillsTable(PChar); + charutils::BuildingCharAbilityTable(PChar); + charutils::BuildingCharTraitsTable(PChar); + charutils::BuildingCharWeaponSkills(PChar); + + PChar->UpdateHealth(); + PChar->health.hp = PChar->GetMaxHP(); + PChar->health.mp = PChar->GetMaxMP(); + + charutils::SaveCharStats(PChar); + charutils::SaveCharJob(PChar, PChar->GetMJob()); + charutils::SaveCharExp(PChar, PChar->GetMJob()); + + PChar->pushPacket(new CCharJobsPacket(PChar)); + PChar->pushPacket(new CCharStatsPacket(PChar)); + PChar->pushPacket(new CCharSkillsPacket(PChar)); + PChar->pushPacket(new CCharAbilitiesPacket(PChar)); + PChar->pushPacket(new CCharUpdatePacket(PChar)); + PChar->pushPacket(new CMenuMeritPacket(PChar)); + PChar->pushPacket(new CCharSyncPacket(PChar)); + return 0; +} + + +/************************************************************************ +* * +* GM command @setlevel !!! FOR DEBUG ONLY !!! * +* * +************************************************************************/ + inline int32 CLuaBaseEntity::setLevel(lua_State *L) { DSP_DEBUG_BREAK_IF(m_PBaseEntity == NULL); @@ -4194,8 +4289,29 @@ return 1; } + //==========================================================// +inline int32 CLuaBaseEntity::getBCNMloot(lua_State *L){ + DSP_DEBUG_BREAK_IF(m_PBaseEntity == NULL); + DSP_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC); + + CCharEntity* PChar = (CCharEntity*)m_PBaseEntity; + + uint8 inst = 255; + + if(PChar->loc.zone != NULL && PChar->loc.zone->m_InstanceHandler != NULL){ + inst = PChar->loc.zone->m_InstanceHandler->findInstanceIDFor(PChar); + PChar->loc.zone->m_InstanceHandler->openTreasureChest(PChar); + } + + lua_pushinteger( L,inst); + return 1; +} + + +//==========================================================// + //returns 1 if all 3 instances are full. Temp measure until event param struct is found out. inline int32 CLuaBaseEntity::isBcnmsFull(lua_State *L){ DSP_DEBUG_BREAK_IF(m_PBaseEntity == NULL); @@ -4554,7 +4670,9 @@ LUNAR_DECLARE_METHOD(CLuaBaseEntity,hasPartyEffect), LUNAR_DECLARE_METHOD(CLuaBaseEntity,takeMagicDamage), LUNAR_DECLARE_METHOD(CLuaBaseEntity,setLevel), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,setsLevel), LUNAR_DECLARE_METHOD(CLuaBaseEntity,changeJob), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,changesJob), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getWeaponDmg), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getOffhandDmg), LUNAR_DECLARE_METHOD(CLuaBaseEntity,openDoor), @@ -4585,5 +4703,6 @@ LUNAR_DECLARE_METHOD(CLuaBaseEntity,isBehind), LUNAR_DECLARE_METHOD(CLuaBaseEntity,hideNPC), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getStealItem), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,getBCNMloot), {NULL,NULL} }; \ No newline at end of file Index: src/map/lua/lua_baseentity.h =================================================================== --- src/map/lua/lua_baseentity.h (revision 1672) +++ src/map/lua/lua_baseentity.h (working copy) @@ -160,9 +160,9 @@ int32 bcnmLeave(lua_State*); //Leave a bcnm instance int32 isInBcnm(lua_State*); //true if you're INSIDE the bc (not just the status) int32 isBcnmsFull(lua_State*); //true if all 3 instances are full - int32 getInstanceID(lua_State*); //returns 1 2 or 3 if the player can enter a bcnm with the instance assigned + int32 getInstanceID(lua_State*); //returns 1 2 or 3 if the player can enter a bcnm with the instance assigned + int32 getBCNMloot(lua_State*); //triggers if the player opens the chest inside bcnm - int32 getVar(lua_State*); // Returns a character variable int32 setVar(lua_State*); // Sets a character variable @@ -242,7 +242,9 @@ int32 getContainerSize(lua_State*); // Gets the current capacity of a container int32 changeContainerSize(lua_State*); // Increase/Decreases container size int32 setLevel(lua_State*); // sets the character's level + int32 setsLevel(lua_State*); // sets the character's level int32 changeJob(lua_State*); // changes the job of a char (testing only!) + int32 changesJob(lua_State*); // changes the sub job of a char (testing only!) int32 getWeaponDmg(lua_State*); // gets the current equipped weapons' DMG rating int32 getOffhandDmg(lua_State*); // gets the current equipped offhand's DMG rating (used in WS calcs) int32 isWeaponTwoHanded(lua_State*); Index: src/map/lua/luautils.cpp =================================================================== --- src/map/lua/luautils.cpp (revision 1672) +++ src/map/lua/luautils.cpp (working copy) @@ -1331,7 +1331,7 @@ }else if (PChar->PParty->m_PAlliance != NULL) { - for (int32 a = 0; a < PChar->PParty->m_PAlliance->partyList.size(); ++a) + for (uint8 a = 0; a < PChar->PParty->m_PAlliance->partyList.size(); ++a) { for (uint8 i = 0; i < PChar->PParty->m_PAlliance->partyList.at(a)->members.size(); ++i) { Index: src/map/mobutils.cpp =================================================================== --- src/map/mobutils.cpp (revision 1672) +++ src/map/mobutils.cpp (working copy) @@ -225,4 +225,7 @@ } } + + + }; // namespace mobutils \ No newline at end of file Index: src/map/mobutils.h =================================================================== --- src/map/mobutils.h (revision 1672) +++ src/map/mobutils.h (working copy) @@ -34,6 +34,7 @@ { void CalculateStats(CMobEntity* PMob); uint16 GetWeaponDamage(CMobEntity* PMob); + uint8 checkMultiHits(CMobEntity * PMob,uint32 mobid); }; #endif \ No newline at end of file Index: src/map/packet_system.cpp =================================================================== --- src/map/packet_system.cpp (revision 1672) +++ src/map/packet_system.cpp (working copy) @@ -2198,15 +2198,10 @@ } } - } + }else{//normal party member disband + PChar->PParty->RemoveMember(PChar); + } } - - - //normal party member disband - if (PChar->PParty != NULL) - { - PChar->PParty->RemoveMember(PChar); - } return; } @@ -2371,10 +2366,10 @@ { if (PChar->PParty->m_PAlliance != NULL) { - for (int32 i = 0; i < PChar->PParty->m_PAlliance->partyList.size(); ++i) + for (uint8 i = 0; i < PChar->PParty->m_PAlliance->partyList.size(); ++i) { - for (int32 a = 0; a < PChar->PParty->m_PAlliance->partyList.at(i)->members.size(); ++a) + for (uint8 a = 0; a < PChar->PParty->m_PAlliance->partyList.at(i)->members.size(); ++a) { PChar->PParty->m_PAlliance->partyList.at(i)->ReloadPartyMembers((CCharEntity*)PChar->PParty->m_PAlliance->partyList.at(i)->members.at(a)); } @@ -2667,9 +2662,8 @@ { PChar->PParty->PushPacket(PChar, 0, new CChatMessagePacket(PChar, MESSAGE_PARTY, data+6)); - }else if(PChar->PParty->m_PAlliance != NULL) - { - for (int32 i = 0; i < PChar->PParty->m_PAlliance->partyList.size(); ++i) + }else{ //alliance party chat + for (uint8 i = 0; i < PChar->PParty->m_PAlliance->partyList.size(); ++i) { PChar->PParty->m_PAlliance->partyList.at(i)->PushPacket(PChar, 0, new CChatMessagePacket(PChar, MESSAGE_PARTY, data+6)); } @@ -2901,9 +2895,9 @@ { if (PChar->PParty->m_PAlliance != NULL) { - for (int32 a = 0; a < PChar->PParty->m_PAlliance->partyList.size(); ++a) + for (uint8 a = 0; a < PChar->PParty->m_PAlliance->partyList.size(); ++a) { - for (int32 i = 0; i < PChar->PParty->m_PAlliance->partyList.at(a)->members.size(); ++i) + for (uint8 i = 0; i < PChar->PParty->m_PAlliance->partyList.at(a)->members.size(); ++i) { CCharEntity* PPartyMember = (CCharEntity*)PChar->PParty->m_PAlliance->partyList.at(a)->members.at(i); @@ -2913,30 +2907,22 @@ } } } - return; - } - } + + }else{ //normal party - no alliance + for (int32 i = 0; i < PChar->PParty->members.size(); ++i) + { + CCharEntity* PPartyMember = (CCharEntity*)PChar->PParty->members.at(i); - - - //normal party - no alliance - if (PChar->PParty != NULL) - { - for (int32 i = 0; i < PChar->PParty->members.size(); ++i) - { - CCharEntity* PPartyMember = (CCharEntity*)PChar->PParty->members.at(i); - - if (PPartyMember->getZone() == PChar->getZone()) - { - PChar->pushPacket(new CPartyMapPacket(PPartyMember)); - } - } + if (PPartyMember->getZone() == PChar->getZone()) + { + PChar->pushPacket(new CPartyMapPacket(PPartyMember)); + } + } + return; + } } - else - { - PChar->pushPacket(new CPartyMapPacket(PChar)); - } + PChar->pushPacket(new CPartyMapPacket(PChar)); return; } Index: src/map/packets/party_define.cpp =================================================================== --- src/map/packets/party_define.cpp (revision 1672) +++ src/map/packets/party_define.cpp (working copy) @@ -44,10 +44,10 @@ { CAlliance* ourAlliance = PParty->m_PAlliance; - for (int32 a = 0; a < ourAlliance->partyList.size(); ++a) + for (uint8 a = 0; a < ourAlliance->partyList.size(); ++a) { - for (int32 i = 0; i < ourAlliance->partyList.at(a)->members.size(); ++i) + for (uint8 i = 0; i < ourAlliance->partyList.at(a)->members.size(); ++i) { CBattleEntity* PChar = ourAlliance->partyList.at(a)->members.at(i); @@ -57,31 +57,23 @@ WBUFB(data,12*nextPosition+(0x10)-4) = PChar->getZone(); nextPosition++; } - } return; - } - } - + }else{//regular party + DSP_DEBUG_BREAK_IF(PParty->members.size() > 6); + for (uint8 i = 0; i < PParty->members.size(); ++i) + { + CBattleEntity* PChar = PParty->members.at(i); - //regular party - if (PParty != NULL) - { - DSP_DEBUG_BREAK_IF(PParty->members.size() > 6); - - for (int32 i = 0; i < PParty->members.size(); ++i) - { - CBattleEntity* PChar = PParty->members.at(i); - - WBUFL(data,12*i+(0x08)-4) = PChar->id; - WBUFW(data,12*i+(0x0C)-4) = PChar->targid; - WBUFW(data,12*i+(0x0E)-4) = PChar->PParty->GetMemberFlags(PChar); - WBUFB(data,12*i+(0x10)-4) = PChar->getZone(); - } + WBUFL(data,12*i+(0x08)-4) = PChar->id; + WBUFW(data,12*i+(0x0C)-4) = PChar->targid; + WBUFW(data,12*i+(0x0E)-4) = PChar->PParty->GetMemberFlags(PChar); + WBUFB(data,12*i+(0x10)-4) = PChar->getZone(); + } + } } - } \ No newline at end of file Index: src/map/party.cpp =================================================================== --- src/map/party.cpp (revision 1672) +++ src/map/party.cpp (working copy) @@ -493,9 +493,9 @@ { if (PChar->PParty->m_PAlliance != NULL) { - for (int32 a = 0; a < PChar->PParty->m_PAlliance->partyList.size(); ++a) + for (uint8 a = 0; a < PChar->PParty->m_PAlliance->partyList.size(); ++a) { - for (uint32 i = 0; i < PChar->PParty->m_PAlliance->partyList.at(a)->members.size(); ++i) + for (uint8 i = 0; i < PChar->PParty->m_PAlliance->partyList.at(a)->members.size(); ++i) { CCharEntity* PPartyMember = (CCharEntity*)PChar->PParty->m_PAlliance->partyList.at(a)->members.at(i); Index: src/map/treasure_pool.cpp =================================================================== --- src/map/treasure_pool.cpp (revision 1672) +++ src/map/treasure_pool.cpp (working copy) @@ -178,10 +178,66 @@ return m_count; } + + + /************************************************************************ * * +* Добавляем предмет в хранилище * * * +************************************************************************/ + +uint8 CTreasurePool::AddItemFromChest(uint16 ItemID, CBaseEntity* PNpc) +{ + uint8 SlotID; + uint8 FreeSlotID; + uint32 oldest = -1; + + for (SlotID = 0; SlotID < 10; ++SlotID) + { + if (m_PoolItems[SlotID].ID == 0) + { + FreeSlotID = SlotID; + break; + } + else + { + if (m_PoolItems[SlotID].TimeStamp < oldest) + { + FreeSlotID = SlotID; + oldest = m_PoolItems[SlotID].TimeStamp; + } + } + } + if (SlotID == 10) + { + m_PoolItems[FreeSlotID].TimeStamp = 0; + CheckTreasureItem(gettick(), FreeSlotID); + } + + m_count++; + m_PoolItems[FreeSlotID].ID = ItemID; + m_PoolItems[FreeSlotID].TimeStamp = gettick() - 2500; + + for (uint32 i = 0; i < members.size(); ++i) + { + members[i]->pushPacket(new CTreasureFindItemPacket(&m_PoolItems[FreeSlotID], PNpc)); + } + if (m_TreasurePoolType == TREASUREPOOL_SOLO) + { + CheckTreasureItem(gettick(), FreeSlotID); + } + return m_count; +} + + + + + +/************************************************************************ * * +* * +* * ************************************************************************/ void CTreasurePool::UpdatePool(CCharEntity* PChar) Index: src/map/treasure_pool.h =================================================================== --- src/map/treasure_pool.h (revision 1672) +++ src/map/treasure_pool.h (working copy) @@ -72,6 +72,7 @@ TREASUREPOOLTYPE GetPoolType(); uint8 AddItem(uint16 ItemID, CMobEntity*); + uint8 AddItemFromChest(uint16 ItemID, CBaseEntity*); void LotItem(uint8 SlotID, uint16 Lot); void LotItem(CCharEntity* PChar, uint8 SlotID, uint16 Lot);