标签:
脚本写在 QF下的 //怪物掉落物品触发(针对监视物品):Owner:物品所属玩家,Monster:掉落怪物,item:物品,Accept:是否允许掉落 procedure MonDropItem(Npc: TNormNpc; Owner: TPlayObject; Monster: TActor; Item: TUserItem; Map: TEnvirnoment; const X, Y: Integer; var Accept: Boolean); const Hold_probability_1 = 50; //下面的脚本是随机范围100 小于等于预设值则有效 Hold_probability_2 = 20; Hold_probability_3 = 5; Var Hold_probability, Hold_count, I: Integer; Item_Name: String; begin if Item.StdMode in [5,6,8,10,11,15..24,26..28,30,35] then //检测为装备物品 begin //这里是随机开洞 Hold_probability:= Random(100); Hold_count:= 0; if Hold_probability <= Hold_probability_1 then Hold_count:= Hold_count + 1; if Hold_probability <= Hold_probability_2 then Hold_count:= Hold_count + 1; if Hold_probability <= Hold_probability_3 then Hold_count:= Hold_count + 1; if Hold_count > 0 then begin For I:= 0 to Hold_count - 1 do Item.AddHold[I]:= 0; end; Item_Name:= ‘‘; case Item.StdMode of //这里可以参考引擎说明里面的属性设置随意设置[引擎说明搜 TUserItem] 不过需要注意不同的装备 可以生效的特殊属性有区别 比如19的项链有魔法躲避和幸运 而20的则是准确和敏捷 5,6: begin case Random(10000) of 500..800: begin Item_Name:= ‘魔力的‘; Item.AddMC:= Item.AddMC + 5; end; 1000..1500: begin Item_Name:= ‘秘力的‘; Item.AddSC:= Item.AddSC + 5; end; 8500..9500: begin Item_Name:= ‘锋锐的‘; Item.AddDC:= Item.AddDC + 5; end; end; end; 10,11: begin case Random(10000) of 500..800: begin Item_Name:= ‘硬壳的‘; Item.AddAC:= Item.AddAC + 5; end; 1000..1500: begin Item_Name:= ‘抗魔的‘; Item.AddMAC:= Item.AddMAC + 5; end; 2000..2500: begin Item_Name:= ‘耐用的‘; Item.DuraMax:= Item.DuraMax * 2; Item.Dura:= Item.Dura + Random(Item.DuraMax - Item.Dura); end; end; end; 20: begin case Random(10000) of 100..250: begin Item_Name:= ‘锁定的‘; Item.AddHitPoint:= Item.AddHitPoint + 5; end; end; end; 21: begin case Random(10000) of 100..250: begin Item_Name:= ‘急速的‘; Item.AddHitSpeed:= Item.AddHitSpeed + 5; end; end; end; 23: begin case Random(10000) of 100..250: begin Item_Name:= ‘抗毒的‘; Item.AddPoisonRecover:= Item.AddPoisonRecover + 15; end; end; end; end; Item.Rename(Item_Name + Item.Name); end; end;
标签:
原文地址:http://www.cnblogs.com/91M2/p/5614967.html