🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] ### 一、什么是NPC 在奇迹,除玩家外,其他所有有生命的物体都是NPC,包括商店NPC、一般的NPC和怪物NPC,还有一些特殊的NPC ### 二、NPC属性的定义 在文件:zMu902\IGCData\Monsters\IGC_MonsterList.xml 此文件对每个NPC的属性作了定义,如果你要修改某个怪物的血量、刷新时间等属性时,只要找到对应的怪物进行对应的修改就可以 ~~~ <?xml version="1.0" encoding="utf-8"?> <!-- // == NPC属性定义文件 // ============================================================ Index:编号 ExpType:未知,一般取0 Name:名字 Level:等级 HP:HP值,血量 MP:魔法值 DamageMin:最低攻 DamageMax:最高攻 Defense:防御 MagicDefense:魔防 AttackRate:攻击 BlockRate:防御率 MoveRange:移动范围 AttackType:攻击类型 AttackRange:攻距离 ViewRange:视野 MoveSpeed:移动速度 AttackSpeed:攻速度 RegenTime:重生时间(秒) Attribute:类型 未知 ItemDropRate:物品爆率 MoneyDropRate:爆钱率 MaxItemLevel:暴出物的最大等级 MonsterSkill:技能 IceRes:抗冰冻 PoisonRes:抗毒性 LightRes抗雷 FireRes抗火性 PentagramMainAttrib:主属性类型 PentagramAttribPattern:次属性 PentagramDamageMin:属性最小攻击力 PentagramDamageMax:属性最大攻击力 PentagramAttackRate:属性攻击率 PentagramDefenseRate:属性防御率 PentagramDefense:属性防御 /////////////////////////////////////////////////////////////////////////////////////////////// --> <MonsterList> <Monster Index="0" ExpType="0" Name="牛怪" Level="6" HP="100" MP="0" DamageMin="16" DamageMax="20" Defense="6" MagicDefense="0" AttackRate="28" BlockRate="6" MoveRange="3" AttackType="0" AttackRange="1" ViewRange="5" MoveSpeed="400" AttackSpeed="1600" RegenTime="1" Attribute="2" ItemDropRate="130" MoneyDropRate="20" MaxItemLevel="6" MonsterSkill="0" IceRes="0" PoisonRes="0" LightRes="0" FireRes="0" PentagramMainAttrib="0" PentagramAttribPattern="0" PentagramDamageMin="0" PentagramDamageMax="0" PentagramAttackRate="0" PentagramDefenseRate="0" PentagramDefense="4" /> ~~~ ### 三、NPC在地图中位置的定义和修改 **1. 商店NPC** 控制商店NPC所处地图位置的文件是:zMuServer\IGCData\IGC_ShopList.xml ~~~ NPCIndex:NPC编号 MapNumber:地图编号 PosX:X轴坐标 PosY:Y轴坐标 Dir:NPC朝向 0:中心 1:西南 2:南方 3:东南 4:东方 5:东北 6:北方 7:西北 8:西部 -1:随机 VipType: Minimum VIP Level to use the shop // ~ 0: Free and any VIP Type // ~ 1: Player with Bronze, Silver, Gold, Platinum VIP can use the shop // ~ 2: Silver, Gold, Platinum // ~ 3: Gold, Platinum // ~ 4: Platinum only // Or other defined VIP Type according to IGC_VipSettings.xml GMShop:是否是只有GM才能访问, 0/1 FileName:对应的商店物品定义文件,在IGCData\Shops\文件夹下 MossMerchant: defines a Moss Merchant Lottery Shop, only for NPC 492, should always be 1 BattleCore: Defines a shop located on Battle Core server, if so set to 1 --> <ShopList> <Shop NPCIndex="251" MapNumber="0" PosX="116" PosY="141" Dir="3" VipType="0" GMShop="0" FileName="NPC(251)_Hanzo_the_Blacksmith.xml" /> <!-- Lorencia --> <Shop NPCIndex="251" MapNumber="34" PosX="145" PosY="14" Dir="1" VipType="0" GMShop="0" FileName="NPC(251)_Hanzo_the_Blacksmith.xml" /> <!-- CryWolf --> ~~~ **2. 怪物NPC和一般NPC** ~~~ 普通线路怪物排位:zMuServer\IGCData\Monsters\IGC_MonsterSpawn.xml 事件怪物排位:vzMuServer\IGCData\Monsters\IGC_MonsterSpawn_Event.xml 攻城线路怪物排位:zMuServer\IGCData\Monsters\IGC_MonsterSpawnCS.xml ~~~ 其定义的格式如下: ~~~ <!--- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ### MonsterSpawn::Map ### // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Number: 地图编号 Number of map to spawn the monster on, refer to IGC_MapList.xml // Name: 地图名称 Name of a map, used for in-file description and logging purpose // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ### MonsterSpawn::Map::Spot ### // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Type: Type of spot: // ~ 0: NPC/Traps // ~ 1: Multiple Monsters Spawn // ~ 2: Single Monster Spawn // ~ 3: Multiple Elemental Monster Spawn // ~ 4: Single Elemental Monster Spawn // Description: Spot description, used for in-file description and logging purpose // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~ Spot attributes description // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Index: Index of monster or NPC to spawn, refer to IGC_MonsterList.xml ~ (Spot Type: 0-3) // Distance: Distance to spawn the monsters/NPC from original location ~ (Spot Type: 0-3) // StartX: StartX Coordinate of monster spawn ~ (Spot Type: 0-3) // StartY: StartY Coordinate of monster spawn ~ (Spot Type: 1, 3) // EndX: End X Coordinate of monster spawn ~ (Spot Type: 0-3) // EndY: End Y Coordinate of monster spawn ~ (Spot Type: 1, 3) // Dir: Direction the monster/NPC looks at after spawn ~ (Spot Type: 0-3) // ~ 0: Central // ~ 1: South-West // ~ 2: South // ~ 3: South-East // ~ 4: East // ~ 5: North-East // ~ 6: North // ~ 7: North-West // ~ 8: West // ~ -1: Random // Count: Count of monsters to spawn ~ (Spot Type: 1, 3) // Element: Element type to spawn the monster with ~ (Spot Type: 3) // ~ 0: No Elemental attribute // ~ 1: Fire // ~ 2: Water // ~ 3: Earth // ~ 4: Wind // ~ 5: Darkness // ~ 6: Random // //~~ IMPORTANT EXCLUSIONS --> ~~~ <MonsterSpawn> <Map Number="0" Name="Lorencia"> <Spot Type="0" Description="NPC"> <Spawn Index="406" Distance="0" StartX="131" StartY="135" Dir="3" /> <!-- 弟子黛彬--> <Spawn Index="226" Distance="0" StartX="122" StartY="110" Dir="3" /> <!-- --> <Spawn Index="240" Distance="0" StartX="147" StartY="145" Dir="1" /> <!-- --> <Spawn Index="240" Distance="0" StartX="146" StartY="110" Dir="3" /> <!-- --> <Spawn Index="257" Distance="0" StartX="132" StartY="165" Dir="3" /> <!-- --> <Spawn Index="257" Distance="0" StartX="132" StartY="90" Dir="3" /> <!-- --> <Spawn Index="257" Distance="0" StartX="170" StartY="129" Dir="1" /> <!-- --> <Spawn Index="249" Distance="10" StartX="131" StartY="88" Dir="1" /> <!-- --> <Spawn Index="249" Distance="20" StartX="173" StartY="125" Dir="3" /> <!-- --> <Spawn Index="249" Distance="20" StartX="94" StartY="130" Dir="7" /> <!-- --> <Spawn Index="249" Distance="20" StartX="94" StartY="125" Dir="7" /> <!-- --> <Spawn Index="249" Distance="30" StartX="131" StartY="148" Dir="1" /> <!-- --> <Spawn Index="257" Distance="0" StartX="96" StartY="129" Dir="1" /> <!-- --> <Spawn Index="375" Distance="0" StartX="132" StartY="161" Dir="3" /> <!-- --> <Spawn Index="543" Distance="0" StartX="144" StartY="127" Dir="2" /> <!-- --> <Spawn Index="547" Distance="0" StartX="139" StartY="138" Dir="3" /> <!-- --> <Spawn Index="584" Distance="0" StartX="114" StartY="132" Dir="3" /> <!-- --> <Spawn Index="579" Distance="0" StartX="130" StartY="126" Dir="3" /> <!-- --> <Spawn Index="478" Distance="0" StartX="130" StartY="129" Dir="3" /> <!-- --> </Spot> <Spot Type="1" Description="Multi~Spawn"> <Spawn Index="3" Distance="30" StartX="180" StartY="90" EndX="226" EndY="244" Dir="-1" Count="45" /> <!-- --> <Spawn Index="2" Distance="30" StartX="180" StartY="90" EndX="226" EndY="244" Dir="-1" Count="40" /> <!-- --> <Spawn Index="2" Distance="30" StartX="135" StartY="20" EndX="240" EndY="88" Dir="-1" Count="20" /> <!-- --> <Spawn Index="0" Distance="30" StartX="135" StartY="20" EndX="240" EndY="88" Dir="-1" Count="45" /> <!-- --> <Spawn Index="6" Distance="30" StartX="95" StartY="168" EndX="175" EndY="244" Dir="-1" Count="20" /> <!-- --> <Spawn Index="14" Distance="30" StartX="95" StartY="168" EndX="175" EndY="244" Dir="-1" Count="15" /> <!-- --> <Spawn Index="1" Distance="30" StartX="8" StartY="11" EndX="94" EndY="244" Dir="-1" Count="45" /> <!-- --> <Spawn Index="4" Distance="30" StartX="8" StartY="11" EndX="94" EndY="244" Dir="-1" Count="45" /> <!-- --> <Spawn Index="7" Distance="30" StartX="8" StartY="11" EndX="60" EndY="80" Dir="-1" Count="15" /> <!-- --> </Spot> </Map> ~~~