Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 梦幻宠物强化 v2.10 for discuz4.1(6-21更新)

[复制链接]
clf2275 发表于 2006-7-6 20:44:49 | 显示全部楼层
原帖由 离恨天 于 2006-7-6 20:40 发表

petinfo.php

没安转 待战视窗那的改法 是不是不需要修改 我查找不到你说的那些字符
回复

使用道具 举报

离恨天 发表于 2006-7-6 21:11:25 | 显示全部楼层
不是啊。我说的是给队员补血和复活那一块~~

我把代码给你全帖上,你到时候覆盖到你的petinfo.php上

  1. <?php
  2. if (!defined('IN_DISCUZ')) {
  3.     exit('Access Denied');
  4. }
  5. if (!groupid == "guest" || $discuz_uid == '') pet_showmessage("您没有权限使用此功能");
  6. $petsettings = $db->fetch_array($db->query("SELECT * FROM " . $tablepre . "petconfig WHERE 1"));
  7. $members = $db->fetch_array($db->query("SELECT * FROM " . $tablepre . "mypetdata WHERE username='$discuz_user'"));
  8. $mypethp2 = $members['mypethp'];
  9. $mypetmaxhp2 = $members['mypetmaxhp'];
  10. $mypetmp2 = $members['mypetmp'];
  11. $mypetmaxmp2 = $members['mypetmaxmp'];
  12. $mypetsp2 = $members['mypetsp'];
  13. $mypetjob = $members[mypetjob];
  14. $hpitem2 = $members['hpitem'];
  15. $mpitem2 = $members['mpitem'];
  16. $bhpitem2 = $members['bhpitem'];
  17. $bmpitem2 = $members['bmpitem'];
  18. $spitem2 = $members['spitem'];
  19. $liveitem2 = $members['liveitem'];
  20. $basichp = $petsettings['basichp'];
  21. $basicsp = $petsettings['basicsp'];
  22. $basicusehp = $petsettings['basicusehp'];
  23. $basicusebhp = $petsettings['basicusebhp'];
  24. $basicusemp = $petsettings['basicusemp'];
  25. $basicusebmp = $petsettings['basicusebmp'];
  26. $hptemp2 = $mypetmaxhp2 - $mypethp2;
  27. $mptemp2 = $mypetmaxmp2 - $mypetmp2;
  28. $pettoday2 = time();
  29. $petlevel2 = pow (log10 ($members[mypetexp] / ($mypetjob * 0.2 + 1)), 3);
  30. $petshowlevel2 = floor ($petlevel2 + 1);

  31. if ($action == "usehp") {
  32.     echo "<META HTTP-EQUIV=REFRESH CONTENT='3;URL=petshop.php?index=petinfo'>";
  33.     if ($hpitem2 < 1) {
  34.         $Showmsg = "";
  35.     } else if ($mypethp2 == $mypetmaxhp2) {
  36.         $Showmsg = "";
  37.     } else if ($mypethp2 == '0' or $mypetsp2 == '0' or $useitem['mypetdead'] == '1') {
  38.         $Showmsg = "";
  39.     } else if ($hptemp2 < $basicusehp) {
  40.         $query = $db->query("UPDATE " . $tablepre . "mypetdata SET mypethp=mypethp+$hptemp2,hpitem=hpitem-1 WHERE username='$discuz_user'");
  41.         $Showmsg = "<font color=green>+$hptemp2</font>";
  42.     } else {
  43.         $query = $db->query("UPDATE " . $tablepre . "mypetdata SET mypethp=mypethp+$basicusehp,hpitem=hpitem-1 WHERE username='$discuz_user'");
  44.         $Showmsg = "<font color=green>+$basicusehp</font>";
  45.     }
  46. }

  47. if ($action == "usebhp") {
  48.     echo "<META HTTP-EQUIV=REFRESH CONTENT='3;URL=petshop.php?index=petinfo'>";
  49.     if ($bhpitem2 < 1) {
  50.         $Showmsg = "";
  51.     } else if ($mypethp2 == $mypetmaxhp2) {
  52.         $Showmsg = "";
  53.     } else if ($mypethp2 == '0' or $mypetsp2 == '0' or $useitem['mypetdead'] == '1') {
  54.         $Showmsg = "";
  55.     } else if ($hptemp2 < $basicusebhp) {
  56.         $query = $db->query("UPDATE " . $tablepre . "mypetdata SET mypethp=mypethp+$hptemp2,bhpitem=bhpitem-1 WHERE username='$discuz_user'");
  57.         $Showmsg = "<font color=green>+$hptemp2</font>";
  58.     } else {
  59.         $query = $db->query("UPDATE " . $tablepre . "mypetdata SET mypethp=mypethp+$basicusebhp,bhpitem=bhpitem-1 WHERE username='$discuz_user'");
  60.         $Showmsg = "<font color=green>+$basicusebhp</font>";
  61.     }
  62. }

  63. if ($action == "usemp") {
  64.     echo "<META HTTP-EQUIV=REFRESH CONTENT='3;URL=petshop.php?index=petinfo'>";
  65.     if ($mpitem2 < 1) {
  66.         $Showmsg2 = "";
  67.     } else if ($mypetmp2 == $mypetmaxmp2) {
  68.         $Showmsg2 = "";
  69.     } else if ($mypethp2 == '0' or $mypetsp2 == '0' or $members['mypetdead'] == '1') {
  70.         $Showmsg2 = "";
  71.     } else if ($mptemp2 < $basicusemp) {
  72.         $query = $db->query("UPDATE " . $tablepre . "mypetdata SET mypetmp=mypetmp+$mptemp2,mpitem=mpitem-1 WHERE username='$discuz_user'");
  73.         $Showmsg2 = "<font color=green>+$mptemp</font>";
  74.     } else {
  75.         $query = $db->query("UPDATE " . $tablepre . "mypetdata SET mypetmp=mypetmp+$basicusemp,mpitem=mpitem-1 WHERE username='$discuz_user'");
  76.         $Showmsg2 = "<font color=green>+$basicusemp</font>";
  77.     }
  78. }

  79. if ($action == "usebmp") {
  80.     echo "<META HTTP-EQUIV=REFRESH CONTENT='3;URL=petshop.php?index=petinfo'>";
  81.     if ($bmpitem2 < 1) {
  82.         $Showmsg2 = "";
  83.     } else if ($mypetmp2 == $mypetmaxmp2) {
  84.         $Showmsg2 = "";
  85.     } else if ($mypethp2 == '0' or $mypetsp2 == '0' or $members['mypetdead'] == '1') {
  86.         $Showmsg2 = "";
  87.     } else if ($mptemp2 < $basicusebmp) {
  88.         $query = $db->query("UPDATE " . $tablepre . "mypetdata SET mypetmp=mypetmp+$mptemp2,bmpitem=bmpitem-1 WHERE username='$discuz_user'");
  89.         $Showmsg2 = "<font color=green>+$mptemp2</font>";
  90.     } else {
  91.         $query = $db->query("UPDATE " . $tablepre . "mypetdata SET mypetmp=mypetmp+$basicusebmp,bmpitem=bmpitem-1 WHERE username='$discuz_user'");
  92.         $Showmsg2 = "<font color=green>+$basicusebmp</font>";
  93.     }
  94. }

  95. if ($action == "usesp") {
  96.     echo "<META HTTP-EQUIV=REFRESH CONTENT='3;URL=petshop.php?index=petinfo'>";
  97.     if ($spitem2 < 1) {
  98.         $Showmsg3 = "";
  99.     } else if ($mypethp2 == '0' or $mypetsp2 == '0' or $members['mypetdead'] == '1') {
  100.         $Showmsg3 = "";
  101.     } else {
  102.         $query = $db->query("UPDATE " . $tablepre . "mypetdata SET mypetsp=$basicsp,spitem=spitem-1 WHERE username='$discuz_user'");
  103.         $Showmsg3 = "<font color=green>+$basicsp</font>";
  104.     }
  105. }

  106. if ($action == "uselive") {
  107.     echo "<META HTTP-EQUIV=REFRESH CONTENT='3;URL=petshop.php?index=petinfo'>";
  108.     if ($liveitem2 < 1) {
  109.         $Showmsg = "";
  110.         $Showmsg2 = "";
  111.     } else if ($mypethp2 > 0 && $mypetsp2 > 0) {
  112.         $Showmsg = "";
  113.         $Showmsg2 = "";
  114.         $Showmsg3 = "";
  115.     } else {
  116.         $query = $db->query("UPDATE " . $tablepre . "mypetdata SET mypethp=$mypetmaxhp2,mypetmp=$mypetmaxmp2,mypetdead=0,mypetsp=$basicsp,liveitem=liveitem-1 WHERE username='$discuz_user'");
  117.         $Showmsg = "<font color=green>+$mypetmaxhp2</font>";
  118.         $Showmsg2 = "<font color=green>+$mypetmaxmp2</font>";
  119.         $Showmsg3 = "<font color=green>+$basicsp</font>";
  120.     }
  121. }

  122. if (!$members[mypet]) {
  123.     pet_showmessage('你还没有宠物啊,快赚钱去买吧~<BR><BR><a href=petshop.php?index=petshop>宠物商店</a>');
  124. }
  125. // 会员宠物
  126. $petoldlevel = $members[mypetlevel];
  127. $petlevel = pow (log10 ($members['mypetexp'] / ($mypetjob * 0.2 + 1)), 3);
  128. $petep = floor (100 * ($petlevel - floor ($petlevel)));
  129. $losexp = intval ($members['mypetexp'] * 0.01);
  130. $petshowlevel = floor ($petlevel + 1);
  131. $petjob = $members[mypetjob];
  132. $points = $members['points'];
  133. $str = $members['str'];
  134. $strtemp = $str * 3 * ($members[mypetjob] + 1) * floor($petlevel / 200 + 1);
  135. $vit = $members['vit'];
  136. $vittemp = $vit * 9;
  137. $vittemp2 = intval($vit * 1.3);
  138. $agi = $members['agi'];
  139. if ($agi >= 30) {
  140.     $agitemp = intval(($agi-30) * 1.5) * ($members[mypetjob] + 1) * floor($petlevel / 200 + 1);
  141. }
  142. $int = $members['kno'];
  143. $inttemp = $int * 5;
  144. $dex = $members['dex'];
  145. $dextemp = intval($dex * 2.7) * ($members[mypetjob] + 1) * floor($petlevel / 200 + 1);
  146. if ($members[item4] == 500) {
  147.     $ftt = 10;
  148. } else {
  149.     $ftt = 0;
  150. }
  151. $petflee = floor($agi / 50) + $ftt;
  152. if ($petflee > 100) {
  153.     $petflee = 99;
  154. }
  155. $level1 = intval($petshowlevel / 2);
  156. $petpic = $members['mypetname'];
  157. $petjob = $members['mypetjob'];
  158. $petgd = $members['mypetgd'];
  159. $tm = $members['tmid'];
  160. if ($petgd <= -1) {
  161.     $color = "red";
  162. } else if ($petgd == 0) {
  163.     $color = "gray";
  164. } else if ($petgd >= 1000) {
  165.     $color = "blue";
  166. }

  167. if ($petgd > 32767) {
  168.     $petgd = 32767;
  169. } else if ($petgd < -32767) {
  170.     $petgd = -32767;
  171. }

  172. if ($members[mypetdead] == 1) {
  173.     $petdead = "<font color=red>死亡</font>";
  174. } else {
  175.     $petdead = "<font color=green>生存</font>";
  176. }
  177. $petsx = $members['mypetsx'];
  178. $pethp = $members['mypethp'];
  179. $petmp = $members['mypetmp'];
  180. $petatk = $members['atktemp'] + $members['mypetatk'] + $strtemp + $members['item1'] + $members['item2'] + 2 + $level1 + $agitemp;
  181. $petmatk = $members['kno'] * 5 * ($petjob + 1) * floor($petlevel / 200 + 1) + 2 + $level1;
  182. $petdef = $members['deftemp'] + $members['deftemp2'] + $members['mypetdef'] + $vittemp2 + $dextemp + $members['item3'] + $members['item4'] + $members['item5'] + 3 + $level1;
  183. if ($petdef < 0) {
  184.     $petdef = 0;
  185. }

  186. $petmaxhp = $members[mypetmaxhp] + ($petshowlevel - $petoldlevel) * 25;
  187. $petmaxmp = $members[mypetmaxmp] + ($petshowlevel - $petoldlevel) * 2;
  188. $petsp = $mypetsp2;
  189. $hpf = floor (100 * ($pethp / $petmaxhp)) - 1;
  190. $mpf = floor (100 * ($petmp / $petmaxmp)) - 1;
  191. $spf = floor (100 * ($petsp / $petsettings['basicsp'])) - 1;
  192. if ($members['openpk'] == 1) {
  193.     $petpk = '接受挑战';
  194. } else {
  195.     $petpk = '躲在家里';
  196. }
  197. if ($hpf >= 98) {
  198.     $hpf = $hpf - 2;
  199. }
  200. if ($mpf >= 98) {
  201.     $mpf = $mpf - 2;
  202. }
  203. if ($spf >= 98) {
  204.     $spf = $spf - 2;
  205. }
  206. if ($petshowlevel > $members[leveltemp2]) {
  207.     $petmaxhp = $members[mypetmaxhp] + ($petshowlevel - $members[leveltemp2]) * 25;
  208.     $petmaxmp = $members[mypetmaxmp] + ($petshowlevel - $members[leveltemp2]) * 2;
  209.     $query = $db->query("UPDATE " . $tablepre . "mypetdata SET mypetlevel=$petshowlevel, leveltemp2=$petshowlevel,mypethp=$petmaxhp,mypetmp=$petmaxmp,mypetmaxhp=$petmaxhp,mypetmaxmp=$petmaxmp,mypetsp=$petsettings[basicsp] WHERE username='$discuz_user'");
  210.     echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL=petshop.php?index=petinfo'>";
  211. }
  212. // 队友数据
  213. if ($members[havetm] == 1) {
  214.     $tmpet = $db->fetch_array($db->query("SELECT * FROM " . $tablepre . "mypetdata WHERE username='$tm'"));
  215.     $tmaxhp = $tmpet['mypetmaxhp'];
  216.     $tmaxmp = $tmpet['mypetmaxmp'];
  217.     $tmpetlevel = pow (log10 ($tmpet[mypetexp] / ($tmpet[mypetjob] * 0.2 + 1)), 3);
  218.     $tmpetshowlevel = floor ($tmpetlevel + 1);
  219.     $tname = $tmpet['mypet'];
  220.     $thost = $tmpet['username'];
  221.     $tmjob = $tmpet[mypetjob];
  222.     $tlevel = $tmpetshowlevel;
  223.     $thp = $tmpet['mypethp'];
  224.     $tmp = $tmpet['mypetmp'];
  225.     $tlevel1 = "{$tmjob}转{$tlevel}级";
  226.     if ($thp <= $tmaxhp * 60 / 100 && $tmpet[mypetdead] != 1) {
  227.         $hpadd = "补血 <a href=petshop.php?index=petinfo&action=ubhptm><font color=red>大</font></a>/<a href=petshop.php?index=petinfo&action=ushptm><font color=red>小</font></a>";
  228.     }
  229.     if ($action == "ubhptm") {
  230.         echo "<META HTTP-EQUIV=REFRESH CONTENT='1;URL=petshop.php?index=petinfo'>";
  231.         if ($members[bhpitem] < 1) {
  232.             $tmhpshow = "<font color=red>NoItem</font>";
  233.         } elseif ($tmpet[mypetdead] == 1) {
  234.             $tmhpshow = "<font color=red>已死亡</font>";
  235.         } else {
  236.             if ($basicusebhp > $tmaxhp - $thp) {
  237.                 $bubhp = $tmaxhp - $thp;
  238.             } else {
  239.                 $bubhp = $basicusebhp;
  240.             }
  241.             $query = $db->query("UPDATE " . $tablepre . "mypetdata SET bhpitem=bhpitem-1,mypethp=mypethp+$bubhp WHERE username='$tm'");
  242.             $tmhpshow = "<font color=green>+$bubhp</font>";
  243.         }
  244.     }
  245.     if ($action == "ushptm") {
  246.         echo "<META HTTP-EQUIV=REFRESH CONTENT='1;URL=petshop.php?index=petinfo'>";
  247.         if ($members[hpitem] < 1) {
  248.             $tmhpshow = "<font color=red>NoItem</font>";
  249.         } elseif ($tmpet[mypetdead] == 1) {
  250.             $tmhpshow = "<font color=red>已死亡</font>";
  251.         } else {
  252.             if ($basicusehp > $tmaxhp - $thp) {
  253.                 $bubhp = $tmaxhp - $thp;
  254.             } else {
  255.                 $bubhp = $basicusehp;
  256.             }
  257.             $query = $db->query("UPDATE " . $tablepre . "mypetdata SET hpitem=hpitem-1,mypethp=mypethp+$bubhp WHERE username='$tm'");
  258.             $tmhpshow = "<font color=green>+$bubhp</font>";
  259.         }
  260.     }

  261.     if ($tmpet[mypetdead] == 0) {
  262.         $tmspet = "<font color=green>生存</font>";
  263.     } else {
  264.         $tmspet = "<font color=red>死亡</font>";
  265.         $ulive = "→<a href=petshop.php?index=petinfo&action=livetm><font color=green>复活?</font></a>";
  266.     }
  267.     if ($action == "livetm") {
  268.         echo "<META HTTP-EQUIV=REFRESH CONTENT='1;URL=petshop.php?index=petinfo'>";
  269.         if ($members[liveitem] < 1) {
  270.             $liveshow = "<font color=red>NoItem</font>";
  271.         } else {
  272.             $query = $db->query("UPDATE " . $tablepre . "mypetdata SET liveitem=liveitem-1,mypetdead=0,mypethp=$tmaxhp,mypetmp=$tmaxmp WHERE username='$tm'");
  273.             $liveshow = "$tm 复活了!";
  274.         }
  275.     }
  276. } else {
  277.     $thost = "--";
  278.     $tlevel1 = "--";
  279.     $tmaxhp = "--";
  280.     $thp = "--";
  281. }
  282. if ($tmpet[opentm] == 0 || $tmpet[havetm] == 0) {
  283.     $query = $db->query("UPDATE " . $tablepre . "mypetdata SET havetm=0,tmid='0' WHERE username='$discuz_user'");
  284. }
  285. // 会员宠物
  286. include template('petinfo');

  287. ?>

复制代码

[ 本帖最后由 离恨天 于 2006-7-6 21:13 编辑 ]
回复

使用道具 举报

clf2275 发表于 2006-7-6 21:53:09 | 显示全部楼层
原帖由 离恨天 于 2006-7-6 21:11 发表
不是啊。我说的是给队员补血和复活那一块~~

我把代码给你全帖上,你到时候覆盖到你的petinfo.php上

<?php
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
if (!groupid == "gues ...

谢谢啊~还有魔法攻击以后 继续魔法攻击的超连接失效了
回复

使用道具 举报

离恨天 发表于 2006-7-6 23:13:09 | 显示全部楼层
那个啊,不用点继续,直接点那个攻击就可以了。
回复

使用道具 举报

离恨天 发表于 2006-7-6 23:13:44 | 显示全部楼层
顺便,大MP蓝瓶商店没有卖,不知道在哪里修改?是不是要动数据库????谁能解答一下?没办法,现在只能送给会员。
回复

使用道具 举报

e5go 发表于 2006-7-7 00:26:39 | 显示全部楼层
支持,怎么我买了宠物还说我没有买???
回复

使用道具 举报

fjch1986 发表于 2006-7-7 08:40:52 | 显示全部楼层
地图美化那,发出来共享下吧!
回复

使用道具 举报

离恨天 发表于 2006-7-7 19:03:51 | 显示全部楼层
还有,PK方面~~会员无法进行技能选择的PK,只出结果没有过程的公式化PK模式让人无法接受。
回复

使用道具 举报

bobbi 发表于 2006-7-7 19:13:51 | 显示全部楼层
还是3.10版的天使宠物功能完善

可惜只有zend版...
回复

使用道具 举报

离恨天 发表于 2006-7-7 23:14:02 | 显示全部楼层
转生宠能不能添加新的种类哇?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-12-23 12:52 , Processed in 0.026888 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表