!addto game
command <attack #target2#; /attack #target2#> {
if property <#name[userid]#; dead> then msg <You cannot do that.> else {
set string <target2; $getobjectname(#target2#)$>
if property <#target2#; attackable> then {
msg <You rush to attack $capfirst(#(target2):alias#)$.>
do <player.att(%userid%; #target2#)>
}
else msg <You cannot attack #(target):article#.>
}
}
' this is a really cool rode for npc's, letting them attack players and each other!
afterturn {
for each object in <#quest.currentroom[userid]#> {
if property <#quest.thing#; attackable> and ( #(quest.thing):t_hp# > 0 ) then {
set string <att_mob; #quest.thing#>
if ( #(att_mob):target# =) or ( $locationof(#(att_mob):target#)$ <> $locationof(#att_mob#)$ ) then do <mob_tar> else {
if ( #(att_mob):target# <>) and ( $locationof(#(att_mob):target#)$ = $locationof(#att_mob#)$ ) then {
' do <mob.att(#att_mob#; #(att_mob):target#)>
do <att.att(#att_mob#; #(att_mob):target#)>
}
}
}
}
}
!end
define procedure <mob_tar>
set numeric <att_rand; $rand(1; 10)$>
if ( #(att_mob):aggro# > %att_rand% ) then {
set numeric <att_tars; 0>
for each object in <$locationof(#att_mob#)$> {
if property <#quest.thing#; netplayer> then {
inc <att_tars>
set string <att_tar[att_tars]; #quest.thing#>
}
else {
if property <#quest.thing#; attackable> and ( #quest.thing# <> #att_mob# ) then {
inc <att_tars>
set string <att_tar[att_tars]; #quest.thing#>
}
}
set numeric <att_rand; $rand(1; %att_tars%)$>
if ( $locationof(#att_tars[att_rand]#)$ = $locationof(#att_mob#)$ ) then {
property <#att_mob#; target=#att_tars[att_rand]#>
if property <#(att_mob):target#; netplayer> then {
for each object in <$locationof(#att_mob#)$> {
if property <#quest.thing#; netplayer> then {
if ( #quest.thing# = #(att_mob):target# ) then {
set numeric <us; #(quest.thing):userid#>
if property <#name[us]#; not blind> then msgto <player%us%; You see $capfirst(#(att_mob):alias#)$ rush towards you.>
}
else {
set numeric <us; #(quest.thing):userid#>
set string <att_def; #(att_mob):target#>
if property <#name[us]#; not blind> then msgto <player%us%; You see $capfirst(#(att_mob):alias#)$ rush towards $capfirst(#(att_def):alias#)$.>
}
}
}
}
else {
for each object in <$locationof(#att_mob#)$> {
if property <#quest.thing#; netplayer> then {
set numeric <us; #(quest.thing):userid#>
set string <att_def; #(att_mob):target#>
if property <#name[us]#; not blind> then msgto <player%us%; You see $capfirst(#(att_mob):alias#)$ rush towards $capfirst(#(att_def):alias#)$.>
}
}
}
}
}
end define
define procedure <player.att>
' p1= userid p2=target.
if property <$parameter(2)$; attackable> then {
set string <att_mob; player$parameter(1)$>
' the part where the poor ol' monster finially get to attack.
set string <pa.tar; $parameter(2)$>
if ( $locationof(#pa.tar#)$ = $locationof(#att_mob#)$ ) then {
set string <att_def; #pa.tar#>
' do <player.att2(player%userid%; $parameter(2)$)>
do <att.att(player$parameter(1)$; $parameter(2)$)>
}
else if property <$parameter(2)$; netplayer> then {
set string <pa; player$parameter(1)$>
set string <pa; $locationof(#pa#)$>
if property <#pa#; pvp> then {
set string <att_mob; player$parameter(1)$>
' the part where the poor ol' monster finially get to attack.
set string <pa.tar; $parameter(2)$>
if ( $locationof(#pa.tar#)$ = $locationof(#att_mob#)$ ) then {
set string <att_def; #pa.tar#>
' do <player.att2(player%userid%; $parameter(2)$)>
do <att.att(player$parameter(1)$; $parameter(2)$)>
}
}
else msgto <$parameter(1)$; |crThis is not a PVP zone.|cb>
}
end define
define procedure <att_att>
set string <att_def; $parameter(2)$>
set string <att_mob; $parameter(1)$>
' the part where the poor ol' monster finially get to attack.
if ( #(att_mob):t_dex# > #(att_def):t_agl# ) then {
set numeric <att_da; #(att_mob):t_str# * 10>
set numeric <att_var; >
if ( $rand(1; 2)$ = 1 ) then set numeric <att_da; %att_da% + #(att_mob):t_str#> else set numeric <att_da; %att_da% - #(tt_mob):t_str#>
set numeric <att_da; %att_da% / 10>
set string <att_wep; #(att_mob):equip_weapon#>
if ( #att_wep# =) or ( #att_wep# = ! ) then set numeric <att_wea; 0> else set numeric <att_wea; #(att_wep):damage#>
if ( %att_wea% < 1 ) then set numeric <att_wea; 0>
set numeric <att_da; %att_da% + %att_wea%>
set string <att_arm; #(att_def):total_armour>
if ( %att_arm% < 1 ) then set numeric <att_arm; 0>
set numeric <att_da; %att_da% - %att_arm%>>
set numeric <hp; #(att_def):c_hp#>
set numeric <hp; %hp% - %att_def%>
property <#att_def#; c_hp=%hp%>
if property <#att_def#; netplayer> then {
for each object in <$locationof(#att_mob#)$> {
if property <#quest.thing#; netplayer> then {
if ( #quest.thing# = #att_def# ) then {
set numeric <us; #(quest.thing):userid#>
msgto <player%us%; $capfirst(#(att_mob):alias#)$ attacks you, causing %att_da% damage.>
}
else {
set numeric <us; #(quest.thing):userid#>
if property <#name[us]#; not blind> then msgto <player%us%; $capfirst(#(att_mob):alias#)$ attacks $capfirst(#(att_def):alias#)$, causing %att_da% damage.>
}
}
}
}
else {
for each object in <$locationof(#att_mob#)$> {
if property <#quest.thing#; netplayer> then {
set numeric <us; #(quest.thing):userid#>
if property <#name[us]#; not blind> then msgto <player%us%; $capfirst(#(att_mob):alias#)$ attacks $capfirst(#(att_def):alias#)$, causing %att_da% damage.>
}
}
}
' check if it's dead...
if ( #(att_def):c_hp# < 1 ) then {
property <#att_def#; dead>
if property <#(att_def#; netplayer> then {
do <player.dead(#(att_def):userid#)$>
}
else {
do <mobclear(#att_def#)>
}
set numeric <expm; #(att_def):level#>
set numeric <expm; %expm% * 100>
set numeric <expm; %expm% / #(attmob):level#>
set numeric <expm; %expm% /10>
set numeric <exp; #(att_mob):exp#>
set numeric <exp; %exp% + %expm%>
property <#att_mob#; exp=%exp%>
if property <#att_mob#; netplayer> then do <levelupcheck(#(att_mob):alias#)> else do <levelupcheck(#att_mob#)>
}
}
' and then if it misses.
else {
if property <#att_def#; netplayer> then {
for each object in <$locationof(#att_mob#)$> {
if property <#quest.thing#; netplayer> then {
if ( #quest.thing# = #att_def# ) then {
set numeric <us; #(quest.thing):userid#>
msgto <player%us%; $capfirst(#(att_mob):alias#)$ tries to attack you, but you manage to dodge out of the way.>
}
else {
set numeric <us; #(quest.thing):userid#>
if property <#name[us]#; not blind> then msgto <player%us%; $capfirst(#(att_mob):alias#)$ tries to attack $capfirst(#(att_def):alias#)$, but $capfirst(#(att_def):alias#)$ manages to dodge out of the way.>
}
}
}
}
else {
for each object in <$locationof(#att_mob#)$> {
if property <#quest.thing#; netplayer> then {
set numeric <us; #(quest.thing):userid#>
if property <#name[us]#; not blind> then msgto <player%us%; $capfirst(#(att_mob):alias#)$ tries to attack $capfirst(#(att_def):alias#)$, but $capfirst(#(att_def):alias#)$ manages to dodge out of the way.>
}
}
}
}
end define Both players and monster use the same battle codes, but have seperate ines for allowing the attack... I'm going to try jsut changing '#quest.currentroom[userid]#' to game on selecting the monsters and test if that allows al monsters to attack. The only fear is if lots of people are playing the afterturn script will go crazy... Oh well that's what the testing is for I guess.Don't know if gambas is any different to normal VB in alot of ways. There should be an option to turn that off - but it's better programming practice to:It was fun but I hate having to 'dim' all the variables!!!
The stats stuff is half done, picking up done, going to reverse it for dropping. I've donw cloning but need to do spawning, which will then be applied for mob spawning... I've got drawings off all the maps and the starting cutscenes and so on are practically done, jsut want to tweek them a bit. Once this list is got through, I'll jsut need to put all the people in and do the story lines... and that'll actually prolly be more than the alpha... lol.* skills...
* 'stat_workout' proc.
* picking up and dropping.
* cloning objects from orig's.
* make monster spawning in an arena/whatever.
* Make main city maps and put them in.
* Make sewer maps, plus complex.
* Finish off cut-scenes and other starting off stuff.
* Redo the dieing stuff... with new idea.
Hope this list sounds good! It'll be first released after 1.6 is finished. I'll play it all myself a few times first tom ake sure stuff works ok at least single player, and that there's enough content to keep you going for a while...Alpha 1.6:
Done:
* Skills.
* Redo stats.
* Simple weather system, with visability.
* Make list of bio mods, effects. (don't ask!)
To-Do:
* Finish bio mods.
* Make journal/quest log.
* Add AR to equipable armour.
* Finish 'stat_workout' proc.
Game:
* One section of main city.
* Estimated 1-2 hours game play on release.
Alpha 1.7:
* Timered fast travel (eg: boat, train, spaceships).
* Put laws in (no killing or stealing).
* Bounty system.
* MAGIC.
* Trading.
* Write up poss new battle system.
Game:
* Whole of city, plus outside.
* Continue with the plot.
* 3-5 hours game play.
Alpha 1.8:
* Space travel.
* Prayer owned houses, ships, etc.
Game:
* New world!
* New race?