|
|
正在制做中的游戏 完全可以以lua脚本控制游戏
npcID = 0;
npctalkLu = [[ 真是个穷鬼 300个便士都没有。等着让人坐你的头卢吧!
<坐就坐!/Close> ]]
npctalkString = [[ <救世主/Help> <时光倒流/TimeBack> <关闭/Close>是不是受不了?给我300个金子我可以叫点人来帮帮你?不同的武士是需要不同的币子的哦! <蜀兵/Play> |<黄巾贼/Playt>| <民兵/Playtt>|<野蛮兵/Playttt> |<山贼/Playtttt>| <弓箭手/Playttttt> | <还是不要了,我没钱!/Close>]]
npctalkArms = [[ 无处不在的神会保佑你的,只要你相信 <关闭/Close> < 烽火救世神兵 /DeityArms>]]
function main()
WAR_SetGoldCount( 50000 );
WAR_ShowNPCChatWnd( npctalkString);
end
function TimeBack()
WAR_ClearWar();
WAR_CloseChatWnd();
end
function Check()
Gold = WAR_GetGoldCount();
if Gold < 300 then
return 0;
end
return 1;
end
function Play()
if Check() == 0 then
WAR_ShowNPCChatWnd( string3 );
return;
else
WAR_SetGoldCount( WAR_GetGoldCount() - 300 );
end
point = { x =0, y = 0 }
newPoint = { x =0, y = 0 }
npcID = WAR_GetNPCID();
WAR_GetActorPos( "point", npcID )
if WAR_GetRoundRandomPos( "newPoint", "point", 2 ) == 1 then
newActorID = WAR_CreateActor( "蜀兵", newPoint.x , newPoint.y, 0 );
WAR_ChangeActorCountry( newActorID, WAR_GetCurrCountry( ) );
end
WAR_GetRoundRandomPos( "newPoint", "point", 5 );
WAR_CreateGroudItem( SG_GetSpecRandomNum(0,WAR_GetItemCount()), newPoint.x, newPoint.y );
WAR_AddScrollText( "增加了一个人物", SG_RGB32(255, 0, 0) )
point =nil;
newPoint = nil;
newActorID = nil;
end
function Playt()
if Check() == 0 then
WAR_ShowNPCChatWnd( string3);
return;
else
WAR_SetGoldCount( WAR_GetGoldCount() - 500 );
end
point = { x =0, y = 0 }
newPoint = { x =0, y = 0 }
npcID = WAR_GetNPCID();
WAR_GetActorPos( "point", npcID )
if WAR_GetRoundRandomPos( "newPoint", "point", 2 ) == 1 then
newActorID = WAR_CreateActor( "黄巾贼", newPoint.x , newPoint.y, 0 );
WAR_ChangeActorCountry( newActorID, WAR_GetCurrCountry( ) );
end
point =nil;
newPoint = nil;
newActorID = nil;
end
function Playtt()
if Check() == 0 then
WAR_ShowNPCChatWnd( string3 );
return;
else
WAR_SetGoldCount( WAR_GetGoldCount() - 500 );
end
point = { x =0, y = 0 }
newPoint = { x =0, y = 0 }
npcID = WAR_GetNPCID();
WAR_GetActorPos( "point", npcID )
if WAR_GetRoundRandomPos( "newPoint", "point", 2 ) == 1 then
newActorID = WAR_CreateActor( "民兵", newPoint.x , newPoint.y, 0 );
WAR_ChangeActorCountry( newActorID, WAR_GetCurrCountry( ) );
end
point =nil;
newPoint = nil;
newActorID = nil;
end
function Playttt()
if Check() == 0 then
WAR_ShowNPCChatWnd( string3 );
return;
else
WAR_SetGoldCount( WAR_GetGoldCount() - 500 );
end
point = { x =0, y = 0 }
newPoint = { x =0, y = 0 }
npcID = WAR_GetNPCID();
WAR_GetActorPos( "point", npcID )
if WAR_GetRoundRandomPos( "newPoint", "point", 2 ) == 1 then
newActorID = WAR_CreateActor( "野蛮兵", newPoint.x , newPoint.y, 0 );
WAR_ChangeActorCountry( newActorID, WAR_GetCurrCountry( ) );
end
point =nil;
newPoint = nil;
newActorID = nil;
end
function Playtttt()
if Check() == 0 then
WAR_ShowNPCChatWnd( string3 );
return;
else
WAR_SetGoldCount( WAR_GetGoldCount() - 500 );
end
point = { x =0, y = 0 }
newPoint = { x =0, y = 0 }
npcID = WAR_GetNPCID();
WAR_GetActorPos( "point", npcID )
if WAR_GetRoundRandomPos( "newPoint", "point", 2 ) == 1 then
newActorID = WAR_CreateActor( "山贼", newPoint.x , newPoint.y, 0 );
WAR_ChangeActorCountry( newActorID, WAR_GetCurrCountry( ) );
end
point =nil;
newPoint = nil;
newActorID = nil;
end
function Playttttt()
if Check() == 0 then
WAR_ShowNPCChatWnd( string3 );
return;
else
WAR_SetGoldCount( WAR_GetGoldCount() - 500 );
end
point = { x =0, y = 0 }
newPoint = { x =0, y = 0 }
npcID = WAR_GetNPCID();
WAR_GetActorPos( "point", npcID )
if WAR_GetRoundRandomPos( "newPoint", "point", 2 ) == 1 then
newActorID = WAR_CreateActor("弓箭手", newPoint.x , newPoint.y, 0 );
WAR_ChangeActorCountry( newActorID, WAR_GetCurrCountry( ) );
end
point =nil;
newPoint = nil;
newActorID = nil;
end
function DeityArms()
point = { x =0, y = 0 } ;
npcID = WAR_GetNPCID();
WAR_GetActorPos( "point", npcID );
for i = WAR_Map_GetWidth () - 10, WAR_Map_GetWidth () do
for j = 0, 10 do
CreateTarID = WAR_CreateActor( "神兵", i , j, 6 );
WAR_ChangeActorCountry( CreateTarID, WAR_GetCurrCountry( ) );
WAR_Actor_Move( CreateTarID, point.x, point.y,1, 0 );
end
end
for k = WAR_Map_GetWidth () - 10, WAR_Map_GetWidth () do
for l = WAR_Map_GetHeight() - 10, WAR_Map_GetHeight() do
CreateTarID = WAR_CreateActor( "神兵", k , l, 6 );
WAR_ChangeActorCountry( CreateTarID, WAR_GetCurrCountry( ) );
WAR_Actor_Move( CreateTarID, point.x, point.y,1, 0 );
end
end
point =nil;
CreateTarID = nil;
end
function Help()
WAR_ShowNPCChatWnd( npctalkArms );
end
function NotPlay()
WAR_ShowNPCChatWnd( npctalkLu);
end
function Close()
WAR_CloseChatWnd();
end


 |
|