I few easy modifications. Please check inside

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 095. Note: Core 095 is no longer officially supported.
Post Reply
Damien
Adept Poster
Posts: 82
Joined: Sat Apr 15, 2006 11:50 am

I few easy modifications. Please check inside

Post by Damien »

Hello!
I've been watching this topic:
http://forums.polserver.com/viewtopic.php?t=201

and I checked at the script and changed it to my x1y1x2y2 in that zone i want it to be noloot.

Everything ecompiles and so on BUT it dont work...

So i wonder if someone see anything that need a modification.

Here it is:

Code: Select all

use uo; 


program noloot( who, corpse, item ) 

var serial := cint(GetObjProperty(corpse, "serial")); 
var komp := getobjproperty(corpse, "npctemplate"); 

if( serial == who.serial ) 
        return 1;    

elseif(komp)
        return ; 

elseif(corpse.x >= 5390 && corpse.y >= 1262 && corpse.x<=5376 && corpse.y<=1279 )
        
        SendSysMessage(who, "Restricted Area! Can't loot!",3,40); 
        return 0; 
else 


return 1; 
endif 


endprogram

And in Config/Itemdesc :

Code: Select all

Container 0x2006
{
    Name                Corpse
    Gump                0x0009
    MinX                20
    MaxX                80
    MinY                85
    MaxY                165
    ControlScript       corpseControl
    RequiresAttention   0
    DecayOnMultis       1
    SaveOnExit          0
    CanRemoveScript     ::noloot 
}
I can't find anything wrong ;(

It makes other people be able to loot my corpse and this message:
SendSysMessage(who, "Restricted Area! Can't loot!",3,40);
Won't show up.
Is the x and y location wrong?
Please Help me!

Code: Select all

Thanks.
qrak
Grandmaster Poster
Posts: 198
Joined: Sun Feb 05, 2006 4:35 pm

Post by qrak »

try:

Code: Select all

use uo; 


program noloot( who, corpse, item ) 

var serial := cint(GetObjProperty(corpse, "serial")); 
var komp := getobjproperty(corpse, "npctemplate"); 

if( serial == who.serial ) 
        return 1;    

elseif(komp) 
        return ; 

elseif(CheckNoLootZone(corpse) == "noloot") 
        
        SendSysMessage(who, "Restricted Area! Can't loot!",3,40); 
        return 0; 
else 


return 1; 
endif

endprogram

function CheckNoLootZone(corpse)

if(corpse.x >= 5390 && corpse.y >= 1262 && corpse.x<=5376 && corpse.y<=1279) // replace x, y with your own coordinates
return "noloot";
else 
return 0;
endif

endfunction


Damien
Adept Poster
Posts: 82
Joined: Sat Apr 15, 2006 11:50 am

Post by Damien »

Nothing happends, still same problem, everybody can loot.

Is the X and Y wrong? i have no clue ;D

And only urself should be able to loot your own corpse, Not other people.
Zacharias
New User
Posts: 16
Joined: Wed Mar 08, 2006 7:30 am

Post by Zacharias »

the corps-coordinates are wrong:

Code: Select all

elseif(corpse.x >= 5390 && corpse.y >= 1262 && corpse.x<=5376 && corpse.y<=1279 ) 
corpse.x >= 5390
(bigger then 5390)
AND
corpse.x<=5376
(smaller then 5376)


there is no number which can be smaller then 5376 and bigger then 5390 at the same time.


correct code:

Code: Select all

elseif(corpse.x >= 5376 && corpse.y >= 1262 && corpse.x<=5390 && corpse.y<=1279 ) 
you have to switch the numbers.

on the other hand you set corpse.y correct. :)
Damien
Adept Poster
Posts: 82
Joined: Sat Apr 15, 2006 11:50 am

Post by Damien »

Wow thanks it works!
Damien
Adept Poster
Posts: 82
Joined: Sat Apr 15, 2006 11:50 am

Post by Damien »

Ahh just another question :)

If i want 2 zones to be nolootzones how should i write?

This is the one i got now for one nolootzone:

Code: Select all

function CheckNoLootZone(corpse) 

if(corpse.x >= 5376 && corpse.y >= 1262 && corpse.x<=5390 && corpse.y<=1279 ) // replace x, y with your own coordinates 
return "noloot"; 
else 
return 0; 
endif 

endfunction 
Should i do like this? :

Code: Select all

function CheckNoLootZone(corpse) 

if(corpse.x >= 5376 && corpse.y >= 1262 && corpse.x<=5390 && corpse.y<=1279 ) // replace x, y with your own coordinates 
else
if(corpse.x >= 5132 && corpse.y >= 1409 && corpse.x<=5379 && corpse.y<=1494 ) // replace x, y with your own coordinates 
return "noloot"; 
else 
return 0; 
endif 

endfunction 
Btw those x,x and y,y i put on the second cordinate lines dont work;(
and i dont know why, If you see something that is wrong please tell me :)
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

You could do


if ( (coords within zone 1) || (coords within zone 2) )
Damien
Adept Poster
Posts: 82
Joined: Sat Apr 15, 2006 11:50 am

Post by Damien »

Damien wrote:

Code: Select all

function CheckNoLootZone(corpse) 

if(corpse.x >= 5376 && corpse.y >= 1262 && corpse.x<=5390 && corpse.y<=1279 ) || (corpse.x >= 5132 && corpse.y >= 1409 && corpse.x<=5379 && corpse.y<=1494 )
return "noloot"; 
else 
return 0; 
endif 

endfunction 
Like that? you notice anything wrong at the cordinations? the second one because it dont work ;(
Post Reply