📄 objnpc.~pas
字号:
function ConditionOfCheckHaveGuild(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckIsGuildMaster(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckIsCastleaGuild(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckIsCastleMaster(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckMemberType(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckMemBerLevel(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckGameGold(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCHECKYEAR(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCHECKMONTH(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCHECKDAY(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCHECKMAPNAME(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckGamePoint(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCHECKYSPOINT(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCHECKJPPOINT(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckNameListPostion(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckGuildList(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckReNewLevel(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckSlaveLevel(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckCreditPoint(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckOfGuild(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckPayMent(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckUseItem(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckBagSize(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckListCount(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckDC(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckMC(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckSC(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckHP(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckMP(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckItemType(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckExp(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckCastleGold(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckPasswordErrorCount(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfIsLockPassword(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfIsLockStorage(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckGuildBuildPoint(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckGuildAuraePoint(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckStabilityPoint(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckFlourishPoint(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckContribution(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckRangeMonCount(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckItemAddValue(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckInMapRange(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckIsAttackGuild(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckIsDefenseGuild(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckCastleDoorStatus(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckIsAttackAllyGuild(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckIsDefenseAllyGuild(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckCastleChageDay(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckCastleWarDay(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckOnlineLongMin(PlayObject:TPlayObject;QuestConditionInfo:pTQuestConditionInfo):Boolean;
function ConditionOfCheckChiefItemCount(PlayObject: TPlayObject;QuestConditionInfo: pTQuestConditionInfo): Boolean;
function ConditionOfCheckNameDateList(PlayObject: TPlayObject;QuestConditionInfo: pTQuestConditionInfo): Boolean;
function ConditionOfCheckMapHumanCount(PlayObject: TPlayObject;QuestConditionInfo: pTQuestConditionInfo): Boolean;
function ConditionOfCheckMapMonCount(PlayObject: TPlayObject;QuestConditionInfo: pTQuestConditionInfo): Boolean;
function ConditionOfCheckVar(PlayObject: TPlayObject;QuestConditionInfo: pTQuestConditionInfo): Boolean;
function ConditionOfCheckServerName(PlayObject: TPlayObject;QuestConditionInfo: pTQuestConditionInfo): Boolean;
function ConditionOfCheckys(PlayObject: TPlayObject;QuestConditionInfo: pTQuestConditionInfo): Boolean;
function GetDynamicVarList(PlayObject: TPlayObject;sType:String;var sName:String):TList;
public
constructor Create();override;
destructor Destroy; override;
procedure Initialize();override;
function Operate(ProcessMsg:pTProcessMessage):Boolean; override;//FFFC
procedure Run; override; //FFFB
procedure Click(PlayObject: TPlayObject);virtual; //FFEB
procedure UserSelect(PlayObject:TPlayObject;sData:String);virtual; //FFEA
procedure GetVariableText(PlayObject:TPlayObject;var sMsg:String;sVariable:String);virtual; //FFE9
function GetLineVariableText(PlayObject:TPlayObject;sMsg:String):String;
procedure GotoLable(PlayObject: TPlayObject;sLabel:String;boExtJmp:Boolean);
function sub_49ADB8(sMsg,sStr,sText:String):String;
procedure LoadNPCScript();
procedure ClearScript();virtual;
procedure SendMsgToUser(PlayObject:TPlayObject;sMsg:String);
procedure SendCustemMsg(PlayObject:TPlayObject;sMsg:String);virtual;
end;
TMerchant = class(TNormNpc) //0x594
m_sScript :String; //0x568
n56C :Integer;
m_nPriceRate :Integer; //0x570 物品价格倍率 默认为 100%
bo574 :Boolean;
m_boCastle :Boolean; //0x575
dwRefillGoodsTick :LongWord; //0x578
dwClearExpreUpgradeTick :LongWord; //0x57C
m_ItemTypeList :TList; //0x580 NPC买卖物品类型列表,脚本中前面的 +1 +30 之类的
m_RefillGoodsList :TList; //0x584
m_GoodsList :TList; //0x588
m_ItemPriceList :TList; //0x58C
m_UpgradeWeaponList :TList;
m_boCanMove :Boolean;
m_dwMoveTime :LongWord;
m_dwMoveTick :LongWord;
m_boBuy :Boolean;
m_boSell :Boolean;
m_boMakeDrug :Boolean;
m_boPrices :Boolean;
m_boStorage :Boolean;
m_boGetback :Boolean;
m_boUpgradenow :Boolean;
m_boGetBackupgnow :Boolean;
m_boRepair :Boolean;
m_boS_repair :Boolean;
m_boSendmsg :Boolean;
m_boGetMarry :Boolean;
m_boGetMaster :Boolean;
m_boUseItemName :Boolean;
private
procedure ClearExpreUpgradeListData();
function GetItemPrice(nIndex:Integer): Integer;
function GetUserPrice(PlayObject:TPlayObject;nPrice: Integer): Integer;
function CheckItemType(nStdMode: Integer): Boolean;
procedure CheckItemPrice(nIndex: Integer);
function GetRefillList(nIndex: Integer): TList;
procedure AddItemPrice(nIndex, nPrice: Integer);
function GetUserItemPrice(UserItem: pTUserItem): Integer;
function GetSellItemPrice(nPrice:integer):Integer;
function AddItemToGoodsList(UserItem:pTUserItem):Boolean;
procedure GetBackupgWeapon(User: TPlayObject);
procedure UpgradeWapon(User: TPlayObject);
procedure ChangeUseItemName(PlayObject:TPlayObject;sLabel,sItemName:String);
procedure SaveUpgradingList;
procedure GetMarry(PlayObject:TPlayObject;sDearName:String);
procedure GetMaster(PlayObject:TPlayObject;sMasterName:String);
public
constructor Create();override;
destructor Destroy; override;
function Operate(ProcessMsg:pTProcessMessage):Boolean; override;
procedure Run;override;
procedure UserSelect(PlayObject:TPlayObject;sData:String);override;
procedure LoadNPCData();
procedure SaveNPCData();
procedure LoadUpgradeList();
procedure RefillGoods();
procedure LoadNPCScript();
procedure Click(PlayObject: TPlayObject);override;
procedure ClearScript();override;
procedure ClearData();
procedure GetVariableText(PlayObject:TPlayObject;var sMsg:String;sVariable:String);override; //FFE9
procedure ClientBuyItem(PlayObject:TPlayObject;sItemName:String;nInt:Integer);
procedure ClientGetDetailGoodsList(PlayObject:TPlayObject;sItemName:String;nInt:Integer);
procedure ClientQuerySellPrice(PlayObject:TPlayObject;UserItem:pTUserItem);
function ClientSellItem(PlayObject:TPlayObject;UserItem:pTUserItem):Boolean;
procedure ClientMakeDrugItem(PlayObject:TPlayObject;sItemName:String);
procedure ClientQueryRepairCost(PlayObject:TPlayObject;UserItem:pTUserItem);
function ClientRepairItem(PlayObject:TPlayObject;UserItem:pTUserItem):Boolean;
procedure SendCustemMsg(PlayObject:TPlayObject;sMsg:String);override;
procedure SendQueryMsg(PlayObject: TPlayObject; sMsg: String);
end;
TMapQuestInfo = record
sMapName :String[14];
nFlags :Integer;
boFlag :Boolean;
sMonName :String[14];
sNeedItem :String[14];
sScriptName :String[14];
boGroup :Boolean;
nFlag :integer;
nValue :integer;
s08 :string[14] ;
s0C :string[14] ;
NPC :TMerchant ;
bo10 :boolean;
end;
pTMapQuestInfo = ^TMapQuestInfo;
TGuildOfficial = class(TNormNpc) //0x568
private
function ReQuestBuildGuild(PlayObject: TPlayObject;
sGuildName: String): Integer;
function ReQuestGuildWar(PlayObject: TPlayObject;
sGuildName: String): Integer;
procedure DoNate(PlayObject: TPlayObject);
procedure ReQuestCastleWar(PlayObject: TPlayObject; sIndex: String);
public
constructor Create();override;
destructor Destroy; override;
procedure GetVariableText(PlayObject:TPlayObject;var sMsg:String;sVariable:String);override; //FFE9
procedure Run;override; //FFFB
procedure Click(PlayObject: TPlayObject);override; //FFEB
procedure UserSelect(PlayObject:TPlayObject;sData:String);override; //FFEA
procedure SendCustemMsg(PlayObject:TPlayObject;sMsg:String);override;
end;
TTrainer = class(TNormNpc) //0x574
n564 :Integer;
m_dw568 :LongWord;
n56C :Integer;
n570 :Integer;
private
public
constructor Create();override;
destructor Destroy; override;
function Operate(ProcessMsg:pTProcessMessage):Boolean; override;//FFFC
procedure Run;override;
end;
// TCastleManager = class(TMerchant)
TCastleOfficial = class(TMerchant)
private
procedure HireArcher(sIndex: String;PlayObject:TPlayObject);
procedure HireGuard(sIndex: String;PlayObject:TPlayObject);
procedure RepairDoor(PlayObject: TPlayObject);
procedure RepairWallNow(nWallIndex:Integer;PlayObject:TPlayObject);
public
constructor Create();override;
destructor Destroy; override;
procedure Click(PlayObject: TPlayObject);override; //FFEB
procedure UserSelect(PlayObject:TPlayObject;sData:String);override; //FFEA
procedure GetVariableText(PlayObject:TPlayObject;var sMsg:String;sVariable:String);override; //FFE9
procedure SendCustemMsg(PlayObject:TPlayObject;sMsg:String);override;
end;
implementation
uses Castle, M2Share, HUtil32, LocalDB, Envir, Guild, EDcode, ObjMon2,
Event;
procedure TCastleOfficial.Click(PlayObject: TPlayObject); //004A4588
begin
if m_Castle = nil then begin
PlayObject.SysMsg('NPC不属于城堡!!!',c_Red,t_Hint);
exit;
end;
if TUserCastle(m_Castle).IsMasterGuild(TGUild(PlayObject.m_MyGuild)) or (PlayObject.m_btPermission >= 3)then
inherited;
end;
procedure TCastleOfficial.GetVariableText(PlayObject: TPlayObject;
var sMsg: String; sVariable: String);
var
// I: Integer;
sText:String;
CastleDoor:TCastleDoor;
// List:TStringList;
begin
inherited;
if m_Castle = nil then begin
sMsg:='????';
exit;
end;
if sVariable = '$CASTLEGOLD' then begin
sText:=IntToStr(TUserCastle(m_Castle).m_nTotalGold);
sMsg:=sub_49ADB8(sMsg,'<$CASTLEGOLD>',sText);
end else
if sVariable = '$TODAYINCOME' then begin
sText:=IntToStr(TUserCastle(m_Castle).m_nTodayIncome);
sMsg:=sub_49ADB8(sMsg,'<$TODAYINCOME>',sText);
end else
if sVariable = '$CASTLEDOORSTATE' then begin
CastleDoor:=TCastleDoor(TUserCastle(m_Castle).m_MainDoor.BaseObject);
if CastleDoor.m_boDeath then sText:='损坏'
else if CastleDoor.m_boOpened then sText:='开启'
else sText:='关闭';
sMsg:=sub_49ADB8(sMsg,'<$CASTLEDOORSTATE>',sText);
end else
if sVariable = '$REPAIRDOORGOLD' then begin
sText:=IntToStr(g_Config.nRepairDoorPrice);
sMsg:=sub_49ADB8(sMsg,'<$REPAIRDOORGOLD>',sText);
end else
if sVariable = '$REPAIRWALLGOLD' then begin
sText:=IntToStr(g_Config.nRepairWallPrice);
sMsg:=sub_49ADB8(sMsg,'<$REPAIRWALLGOLD>',sText);
end else
if sVariable = '$GUARDFEE' then begin
sText:=IntToStr(g_Config.nHireGuardPrice);
sMsg:=sub_49ADB8(sMsg,'<$GUARDFEE>',sText);
end else
if sVariable = '$ARCHERFEE' then begin
sText:=IntToStr(g_Config.nHireArcherPrice);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -